How to: Update fields in code on a bound form in Access 2010
We have a multi-user MS Access app that we have migrated up from Access 97 to Access 2000 then to Access 2003 without major issues. We are now migrating that same code to Access 2010 and we are recieving "Update or CancelUpdate without AddNew or Edit" with some legacy code.
The setup is simple. We have a bound form called frmPeople that is bound to a query that joins a few tables. When the user does a search we find that record and display it in the form. The old (and desired) behavior is the user could then type over existing data and it would be saved as soon as the textbox was exited. Standard MS Access behavior since 1.0. We are now running into two problems:
1) Every third or fourth update works, the rest throws the error above.
2) We used to be able to update the record's TimeStamp in code by simply setting the DateTime field to Now(). Because the field was a column in the underlying table the update would work. Now that line of code fails every time.
Why is is necessary to Edit a record in a bound form in Access 2010? What is the preferred method to ensure all updates are forced to the db and to update various fields in code? The KB articles say to Edit the record first, update the desired fields, then Update the record, but I get lots of conflicts as to which event to call the Edit, modify, and Update process.
Microsoft ApplicationsMicrosoft Access
8/22/2022 - Mon
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst