breakline in afterupdate causes button click to NOT fire

hey guys,

here's a simple empty database.

the problem here is that - i've got a textbox with an afterupdate event and a commandbutton with a onclick event. both event codes have nothing in them except a Stop.

scenario 1:
if i edit the text in the textbox and then click on the commandbutton, by right 2 things should happen. 1 --> the afterupdate will fire off first. 2 --> the onclick will fire off.

HOWEVER after the afterupdate fires off and the code breaks at the Stop and i resume code execution, the onclick event isn't firing off anymore.

scenario 2:
same as scenario 1 except i remove the Stop from the afterupdate event. so there is only 1 stop in the onclick event.

the afterupdate event fires off and then the onclick event fires off.

why does going into break mode stop the onclick event from firing off?

here's the demo database as a proof of concept.

thanks guys!! = ))
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


I would say: If you change anything and then click somewhere else the first thing which happens is the "AfterUpdate" event so the application doesn't know anything about the click at this time because the "LostFocus" and "Exit" events would also happen before. When you set a "Stop" command you moving the window focus to the VBA editor and so the application window cannot get the mouse click message from the OS, it will be sent to the VBA editor window and there it doesn't produce anything.

Yes, you cannot test anything with the debugger on any way, that's a fact. In this case you can use "Stop" only to test anything in the AfterUpdate event and if everything is like you want then you can remove the stop here to see what happens in the Click event procedure.

We programmers often think that the VBA editor is a kind of "ghost" which is in the background and doesn't have anything to do with the rest of the (OS) world but it also has it's own events and reacts sometimes in-between the things you want to test in the application. You can also see the same effect in the other direction.
Try to open a form which has a timer event with 50 which does anything. And while the form is open (and every 50ms the Timer event procedure runs) try to write a code line in the VBA editor - it will constantly try to compile the line although you never leave it, kills spaces, produces errors (because the line is incomplete) and so on. Funny effect.

To say it with Michael Jackson: "You are not alooone...": VBA not and Access not.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
Yes,  "Stop" is an extremely rare command to use in VBA...
I, for example, have never needed to use it...

What exactly are you trying to do, or prove, with this setup?
developingprogrammerAuthor Commented:
thanks Christian and boag2000!!

let me get back to yall on this post ya? i'm so sorry!!

Christian and boag2000, i think the sith lord is winning over the bright side in this question -

my lack of skills are forcing me to lean toward the dark side VBA BUT i won't give up!!!! i need to call upon the great ones (if they can spare some force) to advise me on how to conquer the deathstar and bring SQL back to glory again!!

(in short, could yall help me look at if yall have the time? --> i'm almost done with my project guys!!!! i can't wait to... not party --> but go through all the EE questions again and refactor my code and make it better!!!! = )) one of the first things i'm going to do is create custom controls with validation using custom events!!)
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

developingprogrammerAuthor Commented:
hi Christian and boag2000!

so sorry i just read through your responses. thanks so much for looking into this question and helping me out!! = ))

boag2000 i'm basically trying to be a purist and a pain in my own derriere by trying to understand everything that is happening, turning over every single stone one by one. so in this case i noticed an anomaly and want to understand why = ) the benefits of testing and understanding this setup would be - it helps me be a better tester and understand why when i'm in breakmode, i may not expect certain things to happen - cause previously like what Christian said, i really thought VBA is like a perfect ghost. but - we are not aloooooneee = )) so now when i'm debugging in breakmode, i know what to expect better!! = ))

thanks Christian for the enlightening again!! = )) i was suspecting something like this was happening but my knowledge is very parochial encompassing only VBA at the moment so stuff like windows OS things and hardware, i'm as good as Yoda with an iPhone haha = PP

i really think i need to go study how all those installers are made on windows - for example when i install the FMS software, how they make those windows. i think using VB.NET or VB 6.0 or something like that. i'm really excited to get to know more but i've got to take things one step at a time = ) Access, then database servers, then iPhone, then websites, CMS, desktop OSes. something like that. business IT alignment!! = ))
developingprogrammerAuthor Commented:
hrmm boag2000 i use stop a lot in my code so that when i C&R i won't lose my breakpoints. but yup it's just temporary. i learnt it from Christian and the other experts who taught me this in this question = )

(ignore my stupid posts, only the experts' ones count haha = PP  = )))   )
developingprogrammerAuthor Commented:
Christian i always think of the MJ concert in Munich haha, when he sang that song and hugged the girl = ))

i'm mastering hit Beat It song now = ) or rather when i'm in the bus or train. always got a song on my travels when i can't use my computer!! haha - it's easier to sing from low to high but the other way round, to unzip our vocal cords and transit the mix from more heady tone to a more pharyngeal and throaty resonance again WHILST keeping the larynx down, my goodness that's real hard!! but rewards too!! = ))

yes, there are Install project types for .NET, but better usable in .NET applications.

If you want to create a real good installer which is easy to configure with a professional look, you should use this (the best one I've used so far) and it's free:

See also the 3rd party software on the page with free GUIs to configure this compiler.

The youtube video is not visible in Germany due to GEMA rights...:-)
Singing is great, helps getting the head free.

May the force be with you...?...;-)


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.