If IsOpened

samotek

New member
Local time
Yesterday, 21:37
Joined
Aug 14, 2007
Messages
7
I want to build a common function that is functioning when a certain form is opened and nothing happens when such a form is not opened.I presume I must use the line If ISOpened but I cannot do it properly.Could you help me ?

Public Function MyBack()
If IsOpened Forms!frmClients Then
Forms!frmClients![Registered] = ""
DoCmd.Close acForm, "frmClients”
Else If
Forms!frmCustomers Then
Forms!frmCustomers!Registered = “”
DoCmd.Close acForm, "frmCustomers”
Else If
Forms!Orders! Then
Forms!Orders!Registered = “”
DoCmd.Close acForm, "Orders”
End If

End Function
 
You should be able to use the IsLoaded function to determine if it is open or not.

For example:
Code:
If CurrentProject.AllForms("YourFormNameHere").IsLoaded Then
 

Users who are viewing this thread

Back
Top Bottom