TimerInterval 属性 (权限)Report.TimerInterval property (Access)

可以使用 TimerInterval 属性来指定时间间隔,以毫秒为单位,在报表上的 计时器 事件之间。You can use the TimerInterval property to specify the interval, in milliseconds, between Timer events on a report. 读/写 Read/write Long.

语法Syntax

表达式TimerIntervalexpression.TimerInterval

_表达式_一个代表**Report** 对象的变量。expression A variable that represents a Report object.

说明Remarks

TimerInterval属性设置是介于0和2147483647之间的长整型值。The TimerInterval property setting is a Long Integer value between 0 and 2,147,483,647.

可以通过使用报表的属性表、宏或 Visual Basic 设置此属性。You can set this property by using the report's property sheet, a macro, or Visual Basic.

备注

[!注释] 当使用 Visual Basic,您可以在报表的 Load 事件中设置 TimerInterval 属性。When using Visual Basic, you set the TimerInterval property in the report's Load event.

TimerInterval 属性指定的时间间隔运行 Visual Basic 代码,将代码放在报表的 计时器 事件过程。To run Visual Basic code at intervals specified by the TimerInterval property, put the code in the report's Timer event procedure. 例如,若要每隔 30 秒重新查询记录,放置代码以重新查询记录在报表的 计时器 事件过程中,,然后将 TimerInterval 属性设置为 30000。For example, to requery records every 30 seconds, put the code to requery the records in the report'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. 报表的Load事件过程将报表的TimerInterval属性设置为 1000, 以使图标显示每秒切换一次。The report's Load event procedure sets the report's TimerInterval property to 1000 so that the icon display is toggled once every second.

Sub Report_Load() 
 Me.TimerInterval = 1000 
End Sub 
 
Sub Report_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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.