Well, the title explains it all I think... I get error messages when, for instance, I get to the end of a recordset and click on the 'next' button again. THen I get another message explaining the error message. I don;t want to see these second error messages so if anyone has an idea as to what I can do then that would be more than great!
Thanks for your help already! What I get from access help is that code can be written for specific error messages, etc. That is not what I am looking for though. I get two error messages (one after another). I think there must be a way to somewhere say that this second set of messages is unwanted, but I don't know where and how.
I copied the messages. Please have a look and see if you know what I am doing wrong here?
Your using a macro in a button (am i correct) if you are DONT. Use VBA instead.
Right click your button. Go to the properties sheet.
Go to the on click event and change that to: [Event Procedure]
Now click on the (dots) button next to that.
You are now in the Module window.
Presuming the button is called GaNaarVolgend (GoToNext for english viewers) it should look something like below, assuming there is no other code in the form that is....
Option Compare Database
Private Sub GaNaarVolgend_Click()
Now paste below code between the private and End lines
On Error GoTo Err_GaNaarVolgend_Click
DoCmd.GoToRecord , , acNext 'replace this acNext by acPrevious to go the other way
MsgBox Err.Description 'You can put your own message here if you want to.
Heel erg bedankt! I'm going to try it out straight away. Just to get it straight: does this mean I have to paste this statement in every form that I have, for every event that I have placed? And if so, what do I do with button's that are generated via macro's?
Use macros as little as possible! They cause things like this and are hopelessly inflexible. Use VBA unless there is absolutly no other way (like for instance a Autoexec)
You can create buttons like this using the wizard. It even creates the VBA (where i stole it from btw)
You should indeed replace every OnClick event off every button like this one you have created if you wish to prevent this problem.