P
paquer
I put the following code into the Before Update section of my form;
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Provide the user with the option to save/undo
'changes made to the record in the form
If MsgBox("Changes have been made to this record." _
& vbCrLf & vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes Made...") = vbYes Then
DoCmd.Save
Else
DoCmd.RunCommand acCmdUndo
End If
Last_Updated = Now()
End Sub
I later found out that DoCmd.Save attempts to save the design of the
form, therefore I removed it from the code.
I tried acCmdSave & acCmdSaveRecord but that only produced RunTime
2115 errors...
Right now the code has no Cmd for saving (when they choose the "Y"
option, its just the autosave.
What line of code can I use to give the user the option to save the
Record in the table without affecting the form design or producing
RunTime errors?
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Provide the user with the option to save/undo
'changes made to the record in the form
If MsgBox("Changes have been made to this record." _
& vbCrLf & vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes Made...") = vbYes Then
DoCmd.Save
Else
DoCmd.RunCommand acCmdUndo
End If
Last_Updated = Now()
End Sub
I later found out that DoCmd.Save attempts to save the design of the
form, therefore I removed it from the code.
I tried acCmdSave & acCmdSaveRecord but that only produced RunTime
2115 errors...
Right now the code has no Cmd for saving (when they choose the "Y"
option, its just the autosave.
What line of code can I use to give the user the option to save the
Record in the table without affecting the form design or producing
RunTime errors?