You may also want to turn repainting off if your code makes changes that the user should not or does not need to see.The Echo method does not suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets. Then comment out the line which turns off screen updating and see what happens; you should find that you scroll down the sheet as the numbers get filled. Screen Updating = True Try running it and you should see a short pause followed by column A getting filled with numbers.The first time the example hides the columns, screen updating is turned on; the second time, screen updating is turned off. Hidden = True End If Next c stop Time = Time elapsed Time(i) = (stop Time - start Time) * 24 * 60 * 60 Next i Application.When you run this example, you can compare the respective running times, which are displayed in the message box. Screen Updating = True For i = 1 To 2 If i = 2 Then Application. Using Access 2007 and VBA, I have a few forms which seem to flicker for some unknown reason. The user would select a date by clicking the corresponding toggle button.
Turn screen updating off to speed up your macro code.The code runs correctly, just need to now get rid of this annoying flicker. Hopefully by resolving this form, I can see what is needed to be done for the other forms which flicker as well. 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. The function's code is as follows: Private Function func(Selected Toggle Name As String) ' Date selected Dim thiscontrol As control Dim thistoggle As Toggle Button Dim criteria As String Dim Selected Date As String Dim i As Integer Dim j As Integer Dim SQL As String Dim rs As Recordset Dim db As Database Dim List Int As Integer Dim recset As DAO. Recordset Dim Selected Toggle As Object Set recset = Current Db. 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. The following code example uses the Echo method to prevent the screen from being repainted while certain operations are underway. Well, the function is quite long, but you're looking at the function's entry point. The immediate window says True, then False, then True again as expected, but the code doesn't seem to have any effect on the application. If all of this happens, then you know it is working correctly. Net 2003 and Office 2010 Code: Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA, VB. Screen Updating = False If my Debug = False Then On Error Go To Error Handler I'm afraid that's pretty much it. Screen Updating End Sub As I step through the code when I hove over Application.screen Updating it always says True. Then put it in debug mode and step through with screen updating turned off again, you should find that you still see the numbers going in one by one.