OK I don't want STATIC. This code is in the SubForm. For a test I added the Tag :
This now works because when bolInitialize has wrongly changed to False, the tag corrects it. It's not I hack I want to keep (or be necessary).
This is part of the problem, as there's no problem if it's not called
The boolean is true returning from Playfiles, but is FALSE the next time Form_Current runs.
But if no Title_DblClick it stay TRUE and Form_Current runs every time.
What mechanism might be changing it ?
Code:
Option Explicit
Option Compare Database
Dim bolInitialized As Boolean
Public Sub thisSub() 'This is called only by the Main Form Load event
'set it to true so Current event can be called
bolInitialized = True
Me.Tag = "true"
Call Form_Current
End Sub
Private Sub Form_Close()
Me.Tag = "false"
End Sub
Private Sub Form_Current()
If bolInitialized Or Me.Tag = "true" Then
This is part of the problem, as there's no problem if it's not called
Code:
Private Sub Title_DblClick(Cancel As Integer)
'Stop confirmed bolInitialized is true
Cancel = True
PlayFile "a"
'Stop confirmed bolInitialized is still true
End Sub
But if no Title_DblClick it stay TRUE and Form_Current runs every time.
What mechanism might be changing it ?