Check for whether form is open in Macros

M

Mike C

Is there anyway to check for whether a particular form is open in macros programming environment? I'd like to use it as a condition for a macro in a form

Thank

Mike C.
 
P

Petrucci2000

Hi,

My name is Eric. Thank you for using the Microsoft Access Newsgroups.

You wrote:
"Is there anyway to check for whether a particular form is open in macros
programming environment? I'd like to use it as a condition for a macro in
a form."


You can do so via code and then run the code from a macro, example:

1- Create the following function in a module

Function TestForForm (frm As String)
IF CurrentProject.AllForms(frm).IsLoaded THEN
TestForForm = 0
Else
TestForForm = 1
End IF
End Function

2- Now in your macro have for the condition

TestForForm("the name of your Form")=0


I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."
 

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