update record

B

bb

How to prevent records to be updated except click the 'save' button ? i.e.
Click 'previous' and 'next' will cancel update of all current input.
 
W

Wayne Morgan

Use the form's BeforeUpdate event to cancel the update if your requirements
haven't been met.

Example:
If Msgbox("Save Changes?", vbQuestion + vbYesNo, "Save") = vbNo Then
Cancel = True
End If

If you desire, you could change the Msgbox to a form level variable that you
set the value of in the click event of your button and check for that value.
If the value isn't what it should be, then Cancel the update. However, this
will also keep the record from moving to the previous or next record. To
make the move, the user will need to Undo the changes. Pressing the Esc key
twice will accomplish this.
 
Top