VBA Code to save and/or modify record in access
Posted on 2011-04-19
I know MS Access saves a record when you close a form but I want to make my user form more controlled. I want to have a series of buttons like below:
Save Button - Save's record and writes it to the table
Modify Button - Need to click modify in order to make changes to the record
Undo Button - Undo changes made before saving the record
Close Button - If the record was changed before you close the form make it prompt the user to save or close and undo changes.
The key to this is to have the record locked so you cannot edit it without clicking the modify button first. So I would need to add VBA code to lock the form and only be able to change the data when you click the modify button.
Any ideas on how I can set this up? Or perhaps someone has a sample with this type of functionality in it