using recordset statements with a variable?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I replace the number 4 with the variable fCode, declared as and
Integer, in this statement:

Do Until recSet1.Fields("Code") = 4

Also: I used an SQL statment to select the records for the recordset but
the

Debug.Print recSet1.Fields("Code")

statement doesn't work if my SQL statement only selects one record.
Please help!!!
 
If I understood you correctly then

How do I replace the number 4 with the variable fCode, declared as and
Integer, in this statement:
fCode=4
If not recSet1.eof then
Do Until recSet1!Code = fCode
Debug.Print recSet1!Code
recSet1.movenext
Loop
end if

I used an SQL statment to select the records for the recordset but
the

Debug.Print recSet1.Fields("Code")

statement doesn't work if my SQL statement only selects one record.
Please help!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top