Determine if this is the first record in a Recordset

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

Guest

I'm trying to use an If statement to determine if this is the first record in
a recordset. I've tried
if rs.BOF then
code
end if

Any suggestions?
 
Tony A. said:
I'm trying to use an If statement to determine if this is the first record in
a recordset. I've tried
if rs.BOF then
code
end if


You can use rs.MoveFirst to be sure you're at the first
record.

To check if you're at a specific record, check the
recordset's AbsolutePosition property:

If rs.AbsolutePosition = 1 Then
' first record
End If
 
Back
Top