Stopping a macro if a form is not open

  • Thread starter Thread starter Rob
  • Start date Start date
You can't do directly in a macro, but you can use VBA function and call it
from the macro to see if the function says the form is open or not.


The ACCESS Web has a function that will return a value to tell you if the
form is open or not:
http://www.mvps.org/access/forms/frm0002.htm


Put the function shown there in a regular module (name the module
basFunctions).

Then use a condition similar to this in your macro:

Condition: fIsLoaded("FormName") = -1


The above condition will be true if the form is open.
 
Back
Top