Hi All,
I've decided to start from scratch, and build a new database that demonstrates the problem I'm having.
The test database, attached, has one table with two columns, "FirstName" and "LastName" along with one Form, named "Test1."
I created five record navigation buttons on the Form, by using the "Command Button Wizard", which creates a Macro for record navigation such as "Go To First Record" and "Go To Previous Record."
After I created the five record navigation buttons, I used the "Convert Form's Macros To Visual Basic" feature in "Database Tools" to convert all of the Macros to code.
I then created another button, "Previous Record (Macro)" and also used the "Command Button Wizard" to create a "Go To Previous Record" Macro for the button. I did not convert this Macro to code.
I've set the database to automatically open the "Test1" form.
When you are on the first record, click on the "previous" button with the left-arrow graphic. You will get a "Runtime Error 2105" error. This error pops up even though there is OnError code in the click event for this button.
Also when you are on the first record, click on the "Previous Record (Macro)." This results in a MsgBox with "You can't go to the specified record." This MsgBox is generated by the Macro code behind the "Previous Record (Macro)" button. This behavior is expected, since the Macro is responsible for generating the MsgBox
My original issue was that I was trying to trap the MsgBox in the Macro. My "solution" was to convert the Macro to code.
However, that created a new issue where a runtime error message is generated, even though there is OnError code in the click event.
Does anyone have an idea why there is a runtime error being generated, and how to stop it?
Thanks!