I am developing a Microsoft Access 2010 application for Windows 7 environment.
I have a form that has a 'New Record' button on it. The form is bound to a table. I set the form up so that in order to insert a new record the user has to click the 'New Record' button. I do this because I want to prefill some fields and do other work before the user starts typing.
This works perfectly except when there are no records to begin with. Then when the user clicks the 'New Record' button they see a 'No Current Record.' dialog. If they click 'OK' it goes away and everything works fine. It's just annoying and confusing to the users.
I have tried to trap this error, but it happens before the first line of code in my OnClick event. My assumption is that because there are no records yet, MS is warning about that fact. But I'm not trying to enter data at that point. I'm just trying to click a button.
Any ideas how I can trap/hide the error dialog?