Check if form is open, cancel and alert user

gfultz

Registered User.
Local time
Today, 01:28
Joined
Dec 18, 2009
Messages
51
I have a function to open a form based on linked fields. I don't want a user to be able to open 2 versions let alone 16 of the same record or multiple versions for different records. I would like to build in the following functionality:

1. Check if form (MRSTAT) is open

If it is, Cancel opening the form and alert the user that they must first close the current instance.

If it is not, open the form as directed.

Could anyone help with the vb here?
 
Look in VBA help (and here) at IsLoaded.
 
If you are using ms-access 2007 then
Code:
    If CurrentProject.AllForms("YourFormName").IsLoaded = True Then
          do something
    Else:
         do something else
    End If
 
OR 2000 OR 2002 OR 2003 (the same code is in all of those).

Thanks bob!
I didn't noticed this in 2003, rather I wrote a function in 2003 to check if my form is loaded :)
 
Last edited:
Perfect. I am working. Thanks for the help!
 

Users who are viewing this thread

Back
Top Bottom