Determine End Of Recordset..

  • Thread starter Thread starter Brett Davis
  • Start date Start date
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
 
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
 

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