Error on Next record

duvenhlc

Registered User.
Local time
Tomorrow, 05:16
Joined
Feb 4, 2008
Messages
54
I need help again,

How can I prevent the error "can't go to next record" I have a DB where one can scan through the records with command buttons. I do not use the "standard" record selectors of the form.

Any suggestions

Lance:confused:
 
there may not be a next record. check for the end of the recordset first (and the beginning).
 
Hi, Wazz

You are right, it is at the end of the recordsets. Is there code to check for the end of the recordset to prevent the error mesage.

Thanks
 
search these forums and help files for recordsets and BOF (beginning of file) and EOF (end of file). in vba help just type bof and you'll get 'BOF, EOF Properties'.
 
Do you maybe have an example, I attached a sample database what I tried. Can't get it to work.

Regards

Lance
 

Attachments

Just change your error handlers to this:

Code:
Err_next_Click:
    If Err.Number <> 2105 Then
        MsgBox Err.Description
        Resume Exit_next_Click
    End If
 
Bob, I cant get it to work. It still giving me the error.

Thanks

Lance
 
Bob, I cant get it to work. It still giving me the error.

Thanks

Lance

My goodness, all you had to do was add the
Code:
If Err.Number <> 2105 Then
...the other stuff

End If
into each of the error handlers. See the attached, revised sample.
 

Attachments

Bob, I used the sample on the PC at work with Access 2003 and it works fine. I am on 2007, and it is not working. Is there differance between the coding?

Lance
 
Bob, I used the sample on the PC at work with Access 2003 and it works fine. I am on 2007, and it is not working. Is there differance between the coding?

Lance

Nope I actually did it on Access 2007 too at home and it was fine. Are you sure you've set the database location as a trusted location?
 

Users who are viewing this thread

Back
Top Bottom