Create my own error message??

rjasong23

Registered User.
Local time
Yesterday, 21:48
Joined
Nov 19, 2004
Messages
13
Hey there!

I've got a form setup so that when a command button is clicked, the form tries to populate a field from information in another form using a macro. However, if the other form is not open, it gives me an error message that Access can't find the form, etc and the macro must halt. This is fine because the other form really does need to be open, but I was wondering how to deal with it in one of two ways:

1. Create my own message box to pop-up when that error message comes up giving the user the instruction to open up the other form, or

2. Insert some sort of IIF statement that checks to make sure the form is open in the first place, and opens it up if it isn't.

Any help you could give me regarding this would be most appreciated!
 
Last edited:
First off I would suggest that you have error trapping in all routines. That way you can trap for the specific error and alert the user to the problem with a custom message.

You can test if the form is open by using the IsLoaded function. It is a part of the Northwind db sample and the IsLoaded function is a real function in Access 2003. Search the forum if you need an example.
 

Users who are viewing this thread

Back
Top Bottom