Table of contents

Application.Echo 方法 (访问)Application.Echo Method (Access)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

Echo方法指定 Microsoft Access 是否重新绘制显示屏幕。The Echo method specifies whether Microsoft Access repaints the display screen.


表达式回声(* * EchoOn,* * bstrStatusBarText ** )expression. **Echo( ** EchoOn, ** bstrStatusBarText )

表达式_一个表示应用程序对象的变量。_expression A variable that represents an Application object.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
EchoOnEchoOn必需RequiredIntegerInteger(默认值) 指示屏幕被重画。True (default) indicates that the screen is repainted.
bstrStatusBarTextbstrStatusBarText可选OptionalStringString字符串表达式,指定当重画打开或关闭时,在状态栏上所显示的文本。A string expression that specifies the text to display in the status bar when repainting is turned on or off.


如果运行 Visual Basic 代码对屏幕上显示的对象做一些更改,若关闭屏幕重画直到完成该过程,则代码的运行速度将会加快。如果代码所做的更改是用户不应该或不需要看到的,也可能要关闭重画。If you are running Visual Basic code that makes a number of changes to objects displayed on the screen, your code may work faster if you turn off screen repainting until the procedure has finished running. You may also want to turn repainting off if your code makes changes that the user should not or does not need to see.

Echo方法不会取消显示模式对话框,例如错误消息或弹出式窗体,如属性表。The Echo method does not suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets.

请注意Echo方法不影响功能区的可见性或功能区命令的可用性。Note The Echo method doesn't affect the visibility of the ribbon or the availability of ribbon commands.

如果关闭屏幕重画,屏幕将不显示任何变化,甚至当用户按 Ctrl+Break 或 Visual Basic 遇到一个中断点时也是这样。用户可能需要创建一个打开重画的宏,并将该宏指定给一个键或自定义菜单命令。如果在 Visual Basic 中关闭重画,就可用键组合或菜单命令打开重画。If you turn screen repainting off, the screen won't show any changes, even if the user presses CTRL+BREAK or Visual Basic encounters a breakpoint. You may want to create a macro that turns repainting on and then assign the macro to a key or custom menu command. You can then use the key combination or menu command to turn repainting on if it has been turned off in Visual Basic.

如果关闭屏幕重画,然后试图单步执行代码,将看不到代码执行的过程,也看不到其他提示,直到重画重新打开。但代码将继续执行。If you turn screen repainting off and then try to step through the code, you won't be able to see progress through the code or any other visual cues until repainting is turned back on. However, your code will continue to execute.

请注意 不要混淆Repaint方法使用Echo方法。Echo方法关闭屏幕重画或关闭。重新绘制方法强制立即重画。Note Do not confuse the Echo method with the Repaint method. The Echo method turns screen repainting on or off. The Repaint method forces an immediate screen repainting.


下面的代码示例使用Echo方法防止某些操作时被重画屏幕。当过程打开一个窗体并将它最小化时,用户只看见一个沙漏图标,指示处理正在进行,并且不重画屏幕。完成此任务后,沙漏的变回指针,重画重新打开。The following code example uses the Echo method to prevent the screen from being repainted while certain operations are underway. While the procedure opens a form and minimizes it, the user only sees an hourglass icon indicating that processing is taking place, and the screen isn't repainted. When this task is completed, the hourglass changes back to a pointer and screen repainting is turned back on.

Public Sub EchoOff() 

 ' Open the Employees form minimized. 
 Application.Echo False 
 DoCmd.Hourglass True 
 DoCmd.OpenForm "Employees", acNormal 
 Application.Echo True 
 DoCmd.Hourglass False 

End Sub

另请参阅See also


Application 对象Application Object

© 2018 Microsoft