Use more than one timer event on a form?

W

WembleyBear

Hi

I have a form on which I have set a timer event in order to display the
current date and time. The timer interval is set to 1000 and works as I want
it to. However, I also have a need to refresh a query on the form (actually
on a sub-form) at a regular interval; but not as often as the current time is
updated. So... my question is, is it possible to have more than one timer
event for a form/sub-form & how would I go about that, and if it's not
possible is there another way of going about what I'm trying to achieve?

Thanks very much
Martyn

Access 2000 on Windows Server 2003 over Citrix PS4
 
M

Marshall Barton

WembleyBear said:
I have a form on which I have set a timer event in order to display the
current date and time. The timer interval is set to 1000 and works as I want
it to. However, I also have a need to refresh a query on the form (actually
on a sub-form) at a regular interval; but not as often as the current time is
updated. So... my question is, is it possible to have more than one timer
event for a form/sub-form & how would I go about that, and if it's not
possible is there another way of going about what I'm trying to achieve?


No, but you can use a counter to do something every N
intervals.

Const N as Integer = 30
Sub Form_Timer()
Static intCounter As Integer
Me.txtClock = Now
If intCounter = 0 Then
'do something every N seconds
End If
intCounter = (intCounter + 1) Mod N
End Sub
 

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