Check for Open Form

D

DavidW

I have got a possiblility of 3 forms opening 1 report. Is there a way
through code to check to see if a form is open or not. What I am doing Is
closing certain forms when a print preview is rendered. If I do a
DoCmd.close acform, ("myform"), acsaveyes
on a form that is not open I will get an error.
Is there a way to do this?
Thanks
David
 
P

PC Datasheet

Open Northwind and go to Modules. There is an IsLoaded function there that does
what you want. You can copy that function to a standard module in your database.
Use it like this:

If IsLoaded("MyForm") Then
<Do this if MyForm is open>
End If
 

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