Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update or CancelUpdate without AddNew or Edit

Form Basics

Update or CancelUpdate without AddNew or Edit

by  hermanlaksko  Posted    (Edited  )
The problem occours when updating via vba code on a priv. updated form.
Using the simple - DoCmd.RunCommand acCmdSaveRecord - on the form does not work, not for me anyway.

After thorough testing I find that:

If Forms!YourForm.Dirty Then Forms.YourForm.Dirty = False

Or on a subform:
Me.YourSubFrm.Form.Dirty Then Me.YourSubFrm.Form.Dirty = False


Does the trick, setting the Dirty to false forces the form to write the record to the table(s).
Why the DoCmd action does not work I am unsure of as this command should force a write to tables, however in this case only the Dirty = false does the trick.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top