Determine End Of Recordset..

B

Brett Davis

Hello..

How do I determine the end of a recordset in Access 2000 VBA? I have a form
and when I am on the last record in the table and I click next again on the
navigation buttons it goes to an empty record before I get the error message
that I have reached the end of the recordset. What I want to do is... when
the user clicks next and they are on the last true record in the table I
want the error message to appear and not let them go the empty record. I
hope that makes sense...

Please Advise...

Cheers!

Brett
 
M

Marshall Barton

Brett said:
How do I determine the end of a recordset in Access 2000 VBA? I have a form
and when I am on the last record in the table and I click next again on the
navigation buttons it goes to an empty record before I get the error message
that I have reached the end of the recordset. What I want to do is... when
the user clicks next and they are on the last true record in the table I
want the error message to appear and not let them go the empty record. I
hope that makes sense...

If you set the form's AllowAdditions property to No, they
won't be able to get to the new record.

To answer your specific question, check for the last record
something like this:

With Me.RecordsetClone
.MoveLast
If Me.CurrentRecord = .RecordCount Then
'already on last record
Else
' not last record
End If
End With
 
Top