Detect if a form is open

arclight

Registered User.
Local time
Today, 16:02
Joined
Mar 2, 2013
Messages
13
Hi

I have a main form (Client) from which I open another form (FilterCriteria). Since FilterCriteria code references the Client form, I want to ensure the user can't close Client while FilterCriteria is open.

I'm thinking I need to intercept Client's 'Unload' event and cancel it - but I can't figure out how to check if FilterCriteria is open.

Thanks in advance.

Patrick
 
Ahh - found it! Sorry - false alarm.

FYI, the solution is to intercept the Unload event (which can be canceled) as follows:

============================================
Private Sub Form_Unload(Cancel As Integer)

If (CurrentProject.AllForms("FilterCriteria").IsLoaded) Then
Cancel = True
End If

End Sub
============================================
 

Users who are viewing this thread

Back
Top Bottom