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
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