-
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]
-
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.
-
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 & ...
-
OK!!!
Thank you very much guys!!! i love this forum