Report.TimerInterval 属性 (Access)
使用 TimerInterval 属性可以指定报表上的 Timer 事件之间的间隔(以毫秒为单位)。 读/写 Long。
语法
表达式。TimerInterval
表达 一个代表 Report 对象的变量。
备注
TimerInterval 属性设置是介于 0 和 2,147,483,647 之间的长整型值。
可以通过使用报表的属性表、宏或 Visual Basic 设置此属性。
注意
[!注释] 当使用 Visual Basic,您可以在报表的 Load 事件中设置 TimerInterval 属性。
TimerInterval 属性指定的时间间隔运行 Visual Basic 代码,将代码放在报表的 计时器 事件过程。 例如,若要每隔 30 秒重新查询记录,放置代码以重新查询记录在报表的 计时器 事件过程中,,然后将 TimerInterval 属性设置为 30000。
示例
下面的示例说明如何通过在按钮上显示和隐藏图标来创建一个闪烁按钮。 报表的 Load 事件过程将报表的 TimerInterval 属性设置为 1000,以便每秒切换一次图标显示。
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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。