[RESOLVED] timer code improvement....
I haven't used a timer in a while and would like to know if this is the best way to go about using one. I have the timer enabled in the form load event of the form (used as a splash screen) as follows:
and then the code for the timer is:
VB Code:
Private Sub tmrSplash_Timer()
10 On Error GoTo tmrSplash_Timer_Err
20 If tmrSplash.Interval = 10000 Then
30 frmBRL.Show
40 tmrSplash.Interval = 0
50 tmrSplash.Enabled = False
60 Unload Me
70 End If
80 Exit Sub
tmrSplash_Timer_Err:
90 WriteToErrorLog "BRLTimer"
End Sub
Re: timer code improvement....
I'm not sure what you mean, is frmBRL the main application?
Do you want to to show the main app 10,000ms after the splash screen loads?
If so, then use
VB Code:
Private Sub tmrSplash_Timer()
10 On Error GoTo tmrSplash_Timer_Err
20 frmBRL.Show
30 tmrSplash.Enabled = False
40 Unload Me
50 Exit Sub
tmrSplash_Timer_Err:
60 WriteToErrorLog "BRLTimer"
End Sub
and use
VB Code:
tmrSplash.interval = 10000
tmrsplash.enabled = true
To initialize the timer
Re: timer code improvement....
to answer your question, yes, frmBRL is the main form of the app.
Quote:
Originally Posted by Rob123
I'm not sure what you mean, is frmBRL the main application?
Do you want to to show the main app 10,000ms after the splash screen loads?
If so, then use
VB Code:
Private Sub tmrSplash_Timer()
10 On Error GoTo tmrSplash_Timer_Err
20 frmBRL.Show
30 tmrSplash.Enabled = False
40 Unload Me
50 Exit Sub
tmrSplash_Timer_Err:
60 WriteToErrorLog "BRLTimer"
End Sub
and use
VB Code:
tmrSplash.interval = 10000
tmrsplash.enabled = true
To initialize the timer