Why is my VBA for MS Access Buggy? Why is my VBA for MS Access Buggy? vba vba

Why is my VBA for MS Access Buggy?


The most likely cause is that you have a form open with an active timer event.

What is happening is that as you are editing your code, there is code running at some regular interval. Each time that other code runs, the just-in-time compiler for VBA runs.

Normally when you are writing code, this real-time compilation happens whenever you move from one line of code to another: compile errors are raised, trailing white space is trimmed, etc.

However, in your case you have some piece of code that is running. Before it can run, the compiler must run. And it does the same things it normally does. Most annoyingly, it trims trailing white space from your line.


The solution is to close the form with the active timer event, or set the timer interval to 0 while you are editing your code.