Marshall Brooks
Member
- Local time
- Today, 10:46
- Joined
- Feb 28, 2023
- Messages
- 696
Somewhat hard to explain and I don't remember this happening before.
By default, I have code in my database that closes all other forms except a hidden form, the switchboard, or the current form.
Multiform is a public Boolean variable.
So if I call the current form FrmA, the code looks like this:
That works fine when I open the form, but I noticed today that if I go to design view - either directly in frmA or from the VB Editor Class Object, the frmSwitchboard closes. If I have timers on, it comes back, so the frmLogoutTimer is NOT closing.
If Multiform is set to True, then the switchboard does not close when I go into design view.
There is no code in Form Load that would close open forms (and if it did, it should work when I view the form as well as when I go into design view.
Any ideas what could cause this?
By default, I have code in my database that closes all other forms except a hidden form, the switchboard, or the current form.
Multiform is a public Boolean variable.
So if I call the current form FrmA, the code looks like this:
Code:
Private Sub Form_Activate()
If Multiform = False Then
Dim intx As Integer
Dim intCount As Integer
intCount = Forms.Count - 1
Screen.MousePointer = 11
For intx = intCount To 0 Step -1
If Forms(intx).Name <> "frmA" And Forms(intx).Name <> "frmLogoutTimer" And Forms(intx).Name <> "frmSwitchboard" Then
DoCmd.Close acForm, Forms(intx).Name
End If
Next
Screen.MousePointer = 1
End If
End Sub
That works fine when I open the form, but I noticed today that if I go to design view - either directly in frmA or from the VB Editor Class Object, the frmSwitchboard closes. If I have timers on, it comes back, so the frmLogoutTimer is NOT closing.
If Multiform is set to True, then the switchboard does not close when I go into design view.
There is no code in Form Load that would close open forms (and if it did, it should work when I view the form as well as when I go into design view.
Any ideas what could cause this?