VBA Mod Function with DoEvents: Prevent Not Responding Messages and Provide Feedback on Access Forms
11-September-2020
In this episode, we’re going to explore how to use the VBA Mod function with the DoEvents command,
to allow form updates while your procedure is running. We’ll use a procedure to loop through about 23,000 records,
while performing some task along the way. You will see that Access will lock up, and show “Not Responding” at the top of the screen while it runs.
After changing our procedure to use the Mod function with DoEvents, you will see that Access does not lock up.
It displays a progress counter on a form as the procedure runs, and does not show “Not Responding” at the top of the screen.
This handy technique is extremely valuable for correcting procedures that take a lot of time, lock up users' computers,
and prevent them from using their computer normally while some long process executes.
It also allows you to give some feedback to the user as to how far a process has gone (and has to go).
>
MS Access projects need expertise? Contact me today!