Solved

force save issue

Posted on 2013-10-30
7
239 Views
Last Modified: 2013-10-30
Dear experts -
Hopefully very simply question - I have a save button, but have code in the before update I want to run when someone hits the SAVE button - regardless of whether the form is dirty or not.
I put "me.dirty = false" in the button's code, but this doesn't seem to trigger the beforeupdate code.
Any ideas?
Or do I simply have to put the beforeupdate code into a procedure and call that?
Thanks!
0
Comment
Question by:terpsichore
7 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39612453
<<Or do I simply have to put the beforeupdate code into a procedure and call that?>>

 That's what I'd do.  Put it in a procedure, then call from both places.

 Jim.
0
 

Author Closing Comment

by:terpsichore
ID: 39612465
ok! simple enough - many thanks.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39612467
...and just to be clear, ...
Is the before update event of the *form*, ...or for a control?
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 75
ID: 39612468
"but this doesn't seem to trigger the beforeupdate code."
Then something is wrong ... and you should resolve the issue.
Me.Dirty = False *should* trigger the BU event,

Are you **sure** the Form is actually Dirty ?
IF - this happens to be an unbound form (?), Dirty does not apply. Or if you are changing values in an unbound control - and expecting the Form Dirty property to be set - does not happen in unbound controls.

mx
0
 
LVL 75
ID: 39612478
You are likely masking a problem if you do not troubleshoot why the BU event is not triggering ...
0
 
LVL 57
ID: 39612527
Your other option is to always force the form .dirty in the oncurrent event.   That's problemactic though because OnCurrent gets fired a number of times possibly.

With calling the code though, watch out for other ways to move off the record, like the page up/down key, which by default, let's you move previous/next through records.

Jim.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39612555
Unable to reproduce the issue.
BeforeUpdate is triggered.

Try it by changing any field value in BeforeUpdate event procedure.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question