How can I check if a form is open

P

Paul

Hi Guys,
Can you help? I'm running some VBA code and want to check
if a certain form is open before the next line of code is
processed so that I can ensure the correct ID is being
used. Is there a function I can use similar to "if
cnnCurrentConnection.State = adStateOpen then" to check
that the form is open before I use it or failing that,
anyway to check if it is open at all?

If anyone can help I would really appreciate it,

Many Thanks
Paul
 
A

Allen Browne

In the latest versions of Access, you can use:
If CurrentProject.AllForms("Form1").IsLoaded Then

In earlier versions, copy the IsLoaded() function from the Northwind sample
database.
 

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