Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Applies to

Form Object

You can use the TimerInterval property to specify the interval, in milliseconds, between Timer events on a form. Read/write Long.

expression.TimerInterval

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks

The TimerInterval property setting is a Long Integer value between 0 and 2,147,483,647.

You can set this property by using the form's property sheet, a macro, or Visual Basic for Applications (VBA) code.

Note: When using VBA, you set the TimerInterval property in the form's Load event.

To run VBA code at intervals specified by the TimerInterval property, put the code in the form's Timer event procedure. For example, to requery records every 30 seconds, put the code to requery the records in the form's Timer event procedure, and then set the TimerInterval property to 30000.

Example

The following example shows how to create a flashing button on a form by displaying and hiding an icon on the button. The form's Load event procedure sets the form's TimerInterval property to 1000 so the icon display is toggled once every second.

Sub Form_Load()
Me.TimerInterval = 1000
End Sub
Sub Form_Timer()
Static intShowPicture As Integer
If intShowPicture Then
' Show icon.
Me!btnPicture.Picture = "C:\Icons\Flash.ico"
Else
' Don't show icon.
Me!btnPicture.Picture = ""
End If
intShowPicture = Not intShowPicture
End Sub

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×