Ribbon Save Button: What events are executed?

In Microsoft Access 2010, what events are executed (and in what order) when the Save icon in the ribbon is clicked?  I'd like to know the answer for both the case where I am saving updates to an existing record or when I am saving a new record.

I think I know the answer, but I believe I may be missing one or two events and want to make sure I capture every event that is fired.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"where I am saving updates to an existing record or when I am saving a new record."
No real difference per se.

After Update
After Insert


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
koughdurAuthor Commented:
Does it also fire the On Current or any of the more obscure events?  It seems like even if I put code in the After Update or After Insert events, funny things still happen when users click the 'Save' icon.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
No OnCurrent if you are staying on the same record.
It's possible other 'more obscure events' could happen  ... like OnExit of a control, etc ... depending ... but that seems somewhat unlikely.
Define 'funny things' ...?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

koughdurAuthor Commented:
I think the funny things are happening because the code I put in the After Update trigger is what is causing other events to fire.  I need to add some flags so that I can skip code in On Current, etc. if it is being activated by code in my After Update trigger.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
I don't see how OnCurrent is going to trigger unless you move off of the existing record ... OR ... do a Requery.
koughdurAuthor Commented:
That's the problem.  I have forms that have subforms, etc.  To make sure that after a change occurs that everything the user sees is in sync I need to:

1) Remember where the record cursor is
2) Do a Requery (which always goes back to the first record)
3) Move back to the record before the Requery using FindRecord

All of that causes a bunch of other triggers to fire.  It would be nice if Access had something like Excel where you could disable events, but no such luck.  So I've put in some flags that I set/unset and check to see whether or not to run the OnCurrent code.

I tried to solve this problem by attaching all the code to a Save button, but users still want to click on the 'Save' icon in the ribbon.  I don't think there is anyway to deactivate that icon and I don't really want to get into creating customized ribbons that exclude that particular icon.  So now most of my code is in the Before Update and After Update events so clicking the 'Save' button and the Save icon do the same thing ... or at least that's the goal which I haven't quite achieved but am getting there.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Got it ... and concur that OC will likely trigger one or more times in this scenario.

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.