Eljefegeneo
Still trying to learn
- Local time
- Today, 12:18
- Joined
- Jan 10, 2011
- Messages
- 902
I want to be able to use the following code if a record has already been entered, but is not a new record. That is, if the record exists, then the code will fire. If the record is a new entry, then it won't. I thought of using some sort of selection criteria if the record was entered previously; if Date/Time entered > five minutes, then the code will fire. But, of course, there must be a simpler way. The form is for data entry of "NewNames" into a DB, and a hundred or more can be entered at one sitting.
Thanks.
On Error GoTo BeforeUpdate_Error
If Me.Dirty Then
If MsgBox("The record has changed - do you want to save it?", _
vbYesNo + vbQuestion, "Save Changes") = vbNo Then
Me.Undo
End If
End If
BeforeUpdate_Exit:
Exit Sub
BeforeUpdate_Error:
MsgBox Err.Description
Resume BeforeUpdate_Exit
Thanks.
On Error GoTo BeforeUpdate_Error
If Me.Dirty Then
If MsgBox("The record has changed - do you want to save it?", _
vbYesNo + vbQuestion, "Save Changes") = vbNo Then
Me.Undo
End If
End If
BeforeUpdate_Exit:
Exit Sub
BeforeUpdate_Error:
MsgBox Err.Description
Resume BeforeUpdate_Exit