how to trap the error msg when application start

jamest85

Registered User.
Local time
Today, 12:42
Joined
Jan 20, 2008
Messages
52
Hi:

My Access (A.mdb) application has linked tables which are located in another Access(B.mdb).

If the location of the B.mdb is not correct, the application (A.mdb) will pop up an error msg: "Datebase Startup: Could not find file: "C\Users\correctPath\B.mdb", error Number: 3024.

Can I trap this error msg and change my own msg?

Thanks a lot.

James
 
You can use On Error Goto line in your startup form's Open event
 
Last edited:
You can use On Error Goto line in your startup form's Open event

thanks for your help.

However, Open event (or Load event) doesn't work, still show the error message without going to that event.

Any other suggestion?

Thanks.
 
thanks for your help.

However, Open event (or Load event) doesn't work, still show the error message without going to that event.

Any other suggestion?

Thanks.
The only thing you can do is to use an AutoExec Macro to run code to make sure the links are intact. The AutoExec macro is the only thing that runs BEFORE the links are tested by Access.

Check out this ReLinker provided by MVP Armen Stein.
 
what i do is try to do a dlookup on a field i know should exist to ensure the tables are connected

so, this sort of thing ...

on error goto notlinked
progversion = dlookup("myversion","mastertable")
exit sub

notlinked:
msgbox("The tables are not linked")

---------
note that this will also fail if the table is connected, but the fieldname is wrong - but this should give you a way of proceeding
 

Users who are viewing this thread

Back
Top Bottom