Skip to content

Commit

Permalink
The AutoClose may run after the form has closed (e.g. if the user is …
Browse files Browse the repository at this point in the history
…quick to close it) which may result in an error about object members not available. Since the form is closed, there's no point in setting the timer interval. To avoid the error when debugging, we add a IsLoaded check and skip it if it's not loaded.
  • Loading branch information
bclothier committed Oct 20, 2023
1 parent 5b5e037 commit 490d82e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Version Control.accda.src/forms/frmVCSMain.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,13 @@ End Sub
'---------------------------------------------------------------------------------------
'
Public Sub AutoClose()
Me.TimerInterval = 2000
'The procedure may be called when the form has been closed.
'In this case, a VBA error may occur, so we check if the
'form is loaded before setting the property. We do not use
'the Me.Name because that would be also an error.
If IsLoaded(acForm, "frmVCSMain", False) Then
Me.TimerInterval = 2000
End If
End Sub


Expand Down

0 comments on commit 490d82e

Please sign in to comment.