R Rob Feb 29, 2004 #1 I would like to stop a macro running if a form isn't open, any suggestions? Regards Rob
K Ken Snell Feb 29, 2004 #2 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.
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.