Can a form being open be a condition?

D

Dennis A.

Is there some expression I can use in a macro that indicates that a
particular form is open? I am trying to get a command button on a form to do
different things depending on what form is open in the application at the
moment.
 
A

Abbarition

I don't usually run macros, but I think this will work.
You'll definitely want to test it though! I believe this
will only work if you are running Access 2000 or higher.
I don't think this function is available prior to 2000.
For your condition, use:

[CurrentProject].[AllForms]("FormName").[IsLoaded]=False

=False would mean the form is not open, while =True would
mean the form is open.

Hope that helps!
 

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