Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with an SQL assignment in a Where claues 2

Status
Not open for further replies.

itmasterw

Programmer
Apr 13, 2003
147
US
Hi,
This code part of a large program that I am developing and I have used this extensivly through out the program with success. However, here it is not working because I hve LOAN_TYPE = 11 FHA. I know this is the case because if I take out the where clause it works. If I set it to not Null it works; but this does not give me what I want natually. The problem is that there are spaces in it(and I can not change this), but even if I use brackets, that is [11 FHA], it still does not work. If anyone has any ideas I would really appreaciate it; because I have been tying to figure this out for some time now.
Thank you

Here is the code I am using:

Rs2.Open " Select [CURRENT] FROM [tblEscrow_Avdvance_rtp_Count] WHERE [tblEscrow_Avdvance_rtp_Count].[LOAN_TYPE] = 11 FHA ", _
Cn, adOpenKeyset, adLockOptimistic
Err.Number = 0

If Rs2.State <> 1 Then MsgBox "I am Not a 1 "

Set r2 = xl1.Range((Chr$(66) & Val(6)))
r2 = Rs2![CURRENT]

ITM
 
Thanks that worked. I really appreciate it. By the way how do put the code in the text box like you when you answered my question.

ITM
 
Click on "Process TGML" below the response box. There's a complete list of the TGML tags used on this site. The ones you want are

[ignore]
Code:
Your code here
[/ignore]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top