|
-
Nov 7th, 2000, 09:47 AM
#1
Please take look:
if qry is string
Dim qry As String
adodc1.recordsource = "Select * from myfile where name = . . . .
if qry is integer
Dim qry As Integer
adodc1.recordsource = "Select * from myfile where codname = . . .
can someone complete the select
TIA
[Edited by JuanCarlos60 on 11-07-2000 at 09:55 AM]
-
Nov 7th, 2000, 10:07 AM
#2
Fanatic Member
Depends...
on your DBE, but generally they will take the form:
"SELECT .... WHERE name ='" & qry & "'" (Single quotes around the string
"SELECT .... WHERE name =" & Str(qry) (No quotes needed for an integer)
NB Str(qry) can be put as qry since it will cast to a string anyway, but Str() is more rigorous.
Cheers,
Paul.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 7th, 2000, 10:11 AM
#3
Hyperactive Member
I´m not sure what´s your problem, but I guess that your question is about how to assign a value to a field in a query.
If that´s the problem, in the string case your value must me between ''. ...where name='" & qry & "'...."
For numbers, you don´t need that....where codname=" & qry & ...
-
Nov 7th, 2000, 10:19 AM
#4
OK!!!
Thank you very much guys!!! i love this forum
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
|