Forum Discussion
Phantom Breakpoints in MS Access VBA
- Nov 21, 2020
Although it would be nice if Microsoft found time to correct this, the likelihood of that happening in the context of far more serious, work-stop type bugs, it's not likely to be addressed very soon.
That said, I think you can more or less reliably avoid this problem by making a preventative step one of the things you do just before distributing a new version of an accdb Front End to users.
This "phantom" seems to happen when you've been editing and saving VBA during a session, adding and removing break points. What can happen is that you do end up leaving behind one of those phantoms.
The remedial step I've adopted, based on experience and results shared by others, is that you simply insert and remove one blank line in a module. Then immediately Debug-->Compile your VBA. Then immediately Save it.
Run a Compact & Repair on the accdb. Test in run mode WITHOUT stopping the code anywhere. If the phantom break point does raise its ugly head again, go to the specific procedure and repeat the steps outlined above. At some point, you'll have eliminated them all.
Not as simple, I guess, as being able to count on some automatic process might be, it is effective.
MendipDataSystems Phantom Breaks are not the worst I've seen with the newer version of Access. What I cannot stand is when you have a window open with your form on it that you're designing, and you also have a window open with Code on it. If you make a mistake, and float your mouse over the Code window, it instantly selects that underlying window - even if you didn't click in that code window. VERY (*%&@ annoying. I cannot tell how you angry this makes me.
- isladogsJul 07, 2023MVPThis is a known issue and the Access team have already been made aware of issues caused by this behaviour. However, it also occurs in other Office apps such as Excel which means it needs to be dealt with by the VBA or Office team
You are most likely to experience the issue you have the VBE and Access windows on the same monitor with the VBE partly hidden behind the main Access window
It is easily avoided by not having the two windows overlapping ...or use as a 'feature'
I rarely experience it as I use two monitors and place the VBE on the secondary monitor- BrianDPJul 07, 2023Copper ContributorNothing against the team working on this, I'm sure they must have more important things to work on because it's been what? 2 years or more that this has been a fairly significant problem. I too use two monitors, and I guess it's just me, but I sort of have internal conversations with myself when I'm programming, and I "speak with my mouse" like some people speak with their hands. So, I find it stifling to try to NOT be moving the mouse to and fro when I'm trying to be creative in the development mindset. Anyway, if they ever do fix it I'll be grateful. As it is, I've learned to live with it.
- this_is_sillyJul 07, 2023Copper Contributor
BrianDP Yes! That is super annoying but I discovered what causes that and now use it as a "feature". When your pointer passes over the VBA Code window, if your pointer passes over the "General" or "Declarations" drop downs at the top of the window, then the VBA code window is immediately activated. Now that I know that, I avoid doing that, unless I want to switch windows.
- BrianDPJul 07, 2023Copper ContributorThings should not activate unless you click them. I believe you're the first person I've discussed this with who knew what I was talking about.
WHY would it just decide to activate itself??! It's never done that in the LAST 20 years I've been using this product! Now I've been using my editor with the code window FAR away to the left side of the screen. It's like Microsoft just changing things for no reason at all. It makes you want to never get an update! They've ruined the printer part of the control panel, when you look at items in the print queue, they're so HUGE I can only see a couple of documents at a time.