Capema02
11-12-2019, 07:18 PM
I have VBA code to close 3 Forms after clicking a Command Button. The Forms close just fine, but there is a lot of flickering while they close so I wanted to turn off the screen updating using Application.Echo or DoCmd.Echo. However, once any of the Forms close, it appears the screen updating setting resets. How can I get the .Echo to remain in place while all the Forms close?
DoCmd.Echo False
If CurrentProject.AllForms("Form_1").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
If CurrentProject.AllForms("Form_2").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
If CurrentProject.AllForms("Form_3").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
DoCmd.Echo True
Note, I've tried this in the Click, Mouse Down, and Mouse Up Events of the Command Button.
DoCmd.Echo False
If CurrentProject.AllForms("Form_1").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
If CurrentProject.AllForms("Form_2").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
If CurrentProject.AllForms("Form_3").IsLoaded Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End If
DoCmd.Echo True
Note, I've tried this in the Click, Mouse Down, and Mouse Up Events of the Command Button.