Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax referencing the first row from a recordset in an If Then clause

Status
Not open for further replies.

LowBrow

Technical User
Jun 1, 2001
100
US
I want to build the following statement

If rstQuery.RecordCount > 0 then
frm.dayspaid = "1"
ElseIf
[the first row from rstQuery] = [the current record of frm] then
frm.dayspaid = "1"
Else
frm.dayspaid = Null

But I cannot find the proper syntaxt for naming or referencing the first row
of the recordset. Is there a way?
 
Have you tried this?

IF rstQuery.BOF or rstQuery.EOF Then
rstQuery.movefirst
.......
Else


and then (if record exists), you can reference the fields with their names or numbers like rstQuery!CompanyName etc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top