What I am wanting to do is the following:
I have added a corrrection field to the table. When they go into the edit
form it takes them to the table I want them to have to click on a button that
will tell the correction field Yes. Then changes that were made to that
record would be saved. If they don't click that yes button it won't save
changes. I am trying to be able to run accurate reports later on, on how
many corrections were made and who made the most errors for reviews.
Are you *OPENING THE TABLE* as a table datasheet, from the form? If so you
don't have any control over what they do, and you're making a mistake!
If on the other hand the form is bound to the table, so they're using the form
as a tool to edit the data, then you can put code in the form's BeforeUpdate
event to check the state of the button. Put a concealed textbox on the form,
chkOKToClose let's say. You need three lines of code:
1. In the Form's Current event put
Me!chkOKToClose = False
2. In the command button's Click event set it to True.
3. In the form's BeforeUpdate event check it:
Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!chkOKToClose = False Then
MsgBox "Discarding your edits since you didn't click the button", vbOKOnly
Cancel = True
End If
End Sub