Update record before doing other code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have some code to do and action when the user clicks a button. However,
what code can I use to save any changes that the user may have made on the
current record before executing my code?

I was looking at using an if me.dirty then but do not know how to save the
current record?

Thanks,

Daniel
 
The form's Dirty property will be true if there are unsaved edits in
progress. You can force the save by setting Dirty to false.

So:
If Me.Dirty Then Me.Dirty = False

If you prefer:
RunCommand acCmdSaveRecord
Access applies that to whatever form has the focus, but if you just clicked
the button there's a pretty good chance the right form has focus.
 
Allen,

Thank you so very much. So simple (here I was trying to mess around with
rst.update ....)!

Can't count the number of time you or your website have saved my .....

Daniel
 
Back
Top