Changing TimerInterval in code seems not to work

P

paul.schrum

Access 2007

On my navigator form I have the following code:

Private timesThroughTimer as Long

Private Sub Form_Timer()
'Me.RecordSource = "qry_activePersons"
If timesThroughTimer < 1 Then
Me.cmb_identity.RowSource = "SELECT
qry_activePersons.personID, " & _
"qry_activePersons.personName FROM qry_activePersons;"

Me.TimerInterval = 60
timesThroughTimer = 2
Else
If Len(Me.lbl_message_navigator.Caption) > 0 Then
Me.lbl_message_navigator.Caption = ""
Me.Refresh
End If
End If
End Sub

The code Me.cmb_identity.RowSource = "SELECT qry_activePersons
was necessary to work around a previous problem. I don't think I can
eliminate it. In the form properties I have Timer Interval set to 1.
What I mean to be doing is reset the form timer back to 60 seconds
after the first time through. However this does not seem to be
happening. The function gets called very quickly, effectively
blocking any other operations (like selecting a command button).

Is it possible to change the TimerInterval programmatically from
within Timer Function to prevent this behavior?
 
D

Douglas J. Steele

The value for TimerInterval represents the interval in milliseconds, not
seconds. To specify 60 seconds, you must set TimerInterval to 60000.
 
P

paul.schrum

Thank you Doug.

- Paul

The value for TimerInterval represents the interval in milliseconds, not
seconds. To specify 60 seconds, you must set TimerInterval to 60000.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)












- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top