code to dectect a close form

le888

Registered User.
Local time
Yesterday, 21:49
Joined
Dec 10, 2003
Messages
344
Hello,

What is the code to detect a close form? I have to put in a condition statment. Example :

If forms!frmWords.Close then

...

End if


But this don't work. The word "Close" isn't right. What is the snytaxe?

Thanks,

Le
 
Hi Le,

I have the following in my On Open event in one of my reports that can only be opened if my main Members form is open.

If Not (IsLoaded("Members")) Then
Cancel = True
MsgBox "To preview or print this report, you must open the Members Form in Form view.", 48, "Must Open Dialog Box"
Exit Sub
End If


I hope this helps.

Regards,
Chris
 
Search for the IsLoaded function. Access 2003 finally added the function but it has been around as a custom function in all the Northwind samples.
 
Hi There
Add In The Global Module Public FormOpen as Boolean

Under Form On Load Insert FormOpen=True This Way You Can Get Boolean Status Anywhere.
Set FormOpen=False When Form Is Closed
Hope This Answers your Question .....
 

Users who are viewing this thread

Back
Top Bottom