Why is my VBA for MS Access Buggy?

你离开我真会死。 提交于 2019-12-09 10:14:07

问题


This is kind of a vague question and hard to explain. I'm trying to code my access database, but the VBA portion is really annoying me. Whenever I type something and hit space, it will automatically redo that space and put me back up against the previous word i was typing. Also, Intellisense will come up for a split second, flicker and go away, and revert my cursor to the text that I was just typing. This results in me constantly typing things in places where they shouldn't be and a lack of spaces between elements of my code. Does anyone know why this would be occuring? The database I'm using was created in Access 2007, but I am developing it in 2010. At the top it says Microsoft Access 2007-2010.

Thanks for your help.


回答1:


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.



来源:https://stackoverflow.com/questions/10900005/why-is-my-vba-for-ms-access-buggy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!