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.
I normally do the same steps & in the same order.
1. Make a small change, delete & save
2. C&R
3. Decompile
I normally step 1 is sufficient.
It appears that this can happen when a breakpoint is put somewhere in the code then the VBE is closed without removing the breakpoint followed by closing Access.
When Access is reopened, there is often a phantom breakpoint where it was left in place previously.
I try to always ensure breakpoints are cleared before closing Access so rarely have the problem myself. However the Access team are aware of & looking into this elusive bug
Michael_Brodsky
If you look at the monthly bug fix reports, you'll see that the Access team are working hard to clear the backlog of bugs. They prioritise those having most impact, especially where the bug can be replicated
- MendipDataSystemsJul 06, 2023Copper ContributorInterestingly, Geoff reported what I always thought was the problem. However, whenever I tried to pin it down, it wasn't replicable. I repeated the tests using Geoff's description and the phantom breakpoint refused to show up. I think this will be very tricky for MS to solve reliably.
- BrianDPJul 07, 2023Copper Contributor
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