Multiple Timer Events

matthewnsarah07

Registered User.
Local time
Today, 06:58
Joined
Feb 19, 2008
Messages
192
I have got a form as part of a database which I use as a pop up upon loading the database to warn users of upcoming changes to the system etc.

I use this code on the forms timer event to close it and open the main screen after 10 secs.

Code:
Private Sub Form_Timer()
'On the forms timer event close the start-up form
    DoCmd.Close acForm, "frmUpdate"
'Open up the main switchboard form when the start-up form closes
    DoCmd.OpenForm "frmLeaveRequest"
    
End Sub

However I want a label box on the update form to flash "Update" going on/off each second using:


Code:
Me!UpdateFlash.Visible = Not (UpdateFlash.Visible)

As the events trigger as seperate times, how can i use them both on the same form?

Thanks for your help
 
Change the timer interval to 1000 and then the code to:
Code:
Private Sub Form_Timer()
Static intCount As Integer
intCount=intCount+1
If intCount<> 10 Then
'On the forms timer event close the start-up form
    DoCmd.Close acForm, "frmUpdate"
'Open up the main switchboard form when the start-up form closes
    DoCmd.OpenForm "frmLeaveRequest"
End If
Me!UpdateFlash.Visible = Not (UpdateFlash.Visible)
    
End Sub
 
Bob

I have changed the code and timer as you suggested - it is now coming with an error pointing to the code:

Me!UpdateFlash.Visible = Not (UpdateFlash.Visible)

saying object closed or does not exist - any further advice?
 
Try changing the code to this:

Code:
Private Sub Form_Timer()
Static intCount As Integer
intCount=intCount+1
If intCount<> 10 Then
'On the forms timer event close the start-up form
    DoCmd.Close acForm, "frmUpdate"
'Open up the main switchboard form when the start-up form closes
    DoCmd.OpenForm "frmLeaveRequest"
Else
Me!UpdateFlash.Visible = Not (UpdateFlash.Visible)
End If
    
End Sub
 
Thats got rid of the error but it now only stay keeps frmUpdate open for a second before closing? If I change the timer to 5000 the form does the same and obvioulsly the text does not flash
 
Oops -
change it to:
Code:
Private Sub Form_Timer()
Static intCount As Integer
intCount=intCount+1
If intCount [size=5][color=red][b]=[/b][/color][/size] 10 Then
'On the forms timer event close the start-up form
    DoCmd.Close acForm, "frmUpdate"
'Open up the main switchboard form when the start-up form closes
    DoCmd.OpenForm "frmLeaveRequest"
Else
Me!UpdateFlash.Visible = Not (UpdateFlash.Visible)
End If
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom