How can I tell if a particular form is open in a Subroutine

S

Spidey3721

I am writing a subroutine for a command button that will refresh a separate
(not the form that the button resides on).

If that form is not open, however, I am getting an error message.

I now want to put an If Statement into the button's Sub that will check to
see if that form is open...
 
B

Brendan Reynolds \(MVP\)

In Access 2000 or later ...

If CurrentProject.AllForms("YourFormName").IsLoaded Then

For earlier versions of Access, see the IsLoaded function that is in most of
Microsoft's sample MDBs. I'm going from memory here, but for Access 97 I
think you should find it in either Northwind or Orders, in a module called
something like 'Utility Functions'.
 

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