|
-
May 27th, 1999, 05:24 PM
#1
passing value from text box to SQL
I'm using VB6 and an Access database. I have two text boxes. I want the user to be able to enter a low monetary amount in one text box and a high one in the other, and then pass these values to a recordset's SQL statement, as in ..."WHERE x BETWEEN '600' AND '900'. I can't use variables to pass these values to the SQL statement because Access can't read the variables. Is there any way of doing this? Any help is appreciated.
-
May 27th, 1999, 06:50 PM
#2
Re: passing value from text box to SQL
Hi John:
I hope the other things worked for you. For var's in SQL, do it like this:
strSQL="SELECT ### FROM ### WHERE TABLE.FIELD > " & varName & " AND < " & anotherVarName
Don't forget to put the spaces at the start or end of the strings so your statment does not run together.
-
May 27th, 1999, 06:54 PM
#3
Re: SQL Post Correction
Correction:
strSQL="SELECT ### FROM ### WHERE TABLE.FIELD > " & varName & " AND TABLE.FIELD < " & anotherVarName
Sorry.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|