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!!!
 
Back
Top