MyKidsFirst
Programmer
I found thread 702-559741 to be a solution for a single field update confirmation... However, it doesn't work when you put the same code on multiple fields. Is this because it's in the Before Update event and that applies to the entire record as opposed to a specific field. I'm new to this VB stuff.
I'm simply trying to undo changes on the response "no" for an existing record and not popping up a message on a new record. Seemed like a simple request anyhow. You can see I even tried send keys. Ah well, learning is fun.
I have this for now...I've included notes, old attempts and all (Is that bad etiquette here?):
Private Sub DateReceived_BeforeUpdate(Cancel As Integer)
'Dim Old_Value
'Old_Value = DateReceived.OldValue
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "Do you wish to change the Date Received?"
strMsg = strMsg & "Click Yes to Change or No to Discard changes."
If Not Me.NewRecord Then
ElseIf MsgBox(strMsg, vbQuestion + vbYesNo, "Change Received?") = vbYes Then
'do nothing
Else
'SendKeys "{ESC}", True
' DateReceived.Value = Old_Value
DoCmd.CancelEvent
'Cancel = True
End If
End Sub
Regards,
Sheryll
I'm simply trying to undo changes on the response "no" for an existing record and not popping up a message on a new record. Seemed like a simple request anyhow. You can see I even tried send keys. Ah well, learning is fun.
I have this for now...I've included notes, old attempts and all (Is that bad etiquette here?):
Private Sub DateReceived_BeforeUpdate(Cancel As Integer)
'Dim Old_Value
'Old_Value = DateReceived.OldValue
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "Do you wish to change the Date Received?"
strMsg = strMsg & "Click Yes to Change or No to Discard changes."
If Not Me.NewRecord Then
ElseIf MsgBox(strMsg, vbQuestion + vbYesNo, "Change Received?") = vbYes Then
'do nothing
Else
'SendKeys "{ESC}", True
' DateReceived.Value = Old_Value
DoCmd.CancelEvent
'Cancel = True
End If
End Sub
Regards,
Sheryll