Suppressing default error message

  • Thread starter Thread starter Joy
  • Start date Start date
J

Joy

How do I suppress the default Access error message. I have a form that
opens when the db is started and opens one recordset to check table links.
If the link is broken, it refreshes all table links. I've created my own
message in the Err_Form_Open: section of the error handler to let users know
the links are being refreshed.

Now, the weird part. The form worked exactly as it was supposed to when I
only had a few command buttons on it but when I added a tab control (to
better organize the menus) the default error message displays before my
message. The form still refreshes the links but I'm puzzled as to why I
can't get rid of the default error message. Plus it's annoying and has
become a quest.

Thanks.
Joy
 
Does your Form have any controls or subforms that would automatically try to
"fill" themselves with data when the form opens? That could cause any number
of "can't find data" errors before your relink code has a chance to run.
(Controls on non-active tabs get loaded when the form opens, they won't
wait-to-load-until-tab-is-selected unless you've specifically set up their
properties and additional code to make it happen that way.)

3 approaches: 1) specify a simple "splash" screen as your startup form. Run
your relink code from the open event of that form. Once the relink is
completed (if necessary), open the main form and close the splash. 2) Create
a AutoExec macro that calls a procedure that follows the steps in #1. 3)
make sure controls are unbound and only seet their
rowsource/controlsource/sourceobject properties when their tabs become
active (which would presumably be after your relink code has run).

In any case, you don't want to open any form with data until you know you
have a data connection.

HTH,
 
George,
Thanks for answering. Your answer is right-on. My form does have one tab
that has a multi-select list box for reports. All the other tabs contain
only command buttons to open other forms, reports etc.

I did think of a splash screen but your suggestions 2 and 3 are also good
ideas. You've given me something to think about.
Thanks again.
Joy
 
Back
Top