The Echo method specifies whether Microsoft Access repaints or updates the computer screen.
Application.Echo echoon[, statusbartext]
The Echo method uses the following arguments.
Argument | Description |
echoon | True (default) indicates that the screen is repainted; False indicates that the screen isnt repainted. |
statusbartext | Optional string expression that specifies the text to display in the status bar when repainting is turned on or off. |
If you are running Visual Basic code that makes a number of changes to objects displayed on the screen, your code may be 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 shouldnt see or doesnt need to see.
The Echo method doesnt suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets.
If you turn screen repainting off, the screen will not show any changes, even if the user presses CTRL+BREAK or Visual Basic encounters a breakpoint, until you turn screen repainting back on. You may want to create a macro that turns repainting on and 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 your code, you wont be able to see your progress through the code, or any other visual cues, until repainting is turned back on. However, your code will continue to execute.
Note Dont confuse the Echo method with the Repaint method. The Echo method turns screen updating on or off. The Repaint method forces an immediate screen update.
Application Object, Echo Action.
The following 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 to indicate that processing is taking place, and the screen is not repainted. When this task is completed, the hourglass changes back to a pointer and screen repainting is restored.
Sub EchoOff() Application.Echo False ' Echo off. DoCmd.Hourglass True ' Hourglass on. DoCmd.OpenForm "Employees", acNormal ' Open form. DoCmd.Minimize ' Minimize form. Application.Echo True ' Echo on. DoCmd.Hourglass False ' Hourglass off.Sub