Is the form loaded ??

S

shiro

Hi all,
I'm trying to having a code to check whether my form is open/loaded
I'm trying to use IsLoaded function but don't know the right way
to write the code.

I want the code able to find my form first and check whether it's open
or not,when my form is not open i want to tell the user with a msg box
that my form is not open.

How to write the code?,any help is greatly appreciated.
Thank's,

Shiro
 
A

Allan Murphy

Try

The following code check that the form switchboard_supv is open

in your code add these two lines plus the function is_form_open
Dim check_open_form As Boolean

check_open_form = is_form_open("switchboard_supv")

'this function check if the specified form is open and return strue is the
form is open
Public Function is_form_open(form_name As String) As Boolean

On Error Resume Next

Dim form_is_open As Boolean

form_is_open = CurrentProject.AllForms(form_name).IsLoaded

is_form_open = form_is_open


End Function

Allan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top