EternalMyrtle
I'm still alive
- Local time
- Yesterday, 16:54
- Joined
- May 10, 2013
- Messages
- 533
Hello,
I have been trying to write some code to be used when my forms close. The code checks if other forms are loaded and, if not, opens the switchboard. My problem is that the switchboard is opening all the time. I am hoping it will be an easy fix for someone with more experience.
Here is the code:
Thank you!
I have been trying to write some code to be used when my forms close. The code checks if other forms are loaded and, if not, opens the switchboard. My problem is that the switchboard is opening all the time. I am hoping it will be an easy fix for someone with more experience.
Here is the code:
Code:
Public Function OpenMainMenu()
Dim frm As AccessObject
With CurrentData
With CurrentProject
' "Forms"
For Each frm In .AllForms
If frm.Name <> Screen.ActiveForm.Name Then
If frm.IsLoaded = True Then
Exit Function
Else:
DoCmd.OpenForm "frmMainMenuBDPR"
End If
End If
Next frm
End With
End With
End Function
Thank you!