G
Guest
i have this code in before update of the form. but if i make changes to
patient name , and confirm the changes , i will get error in the code
Private Sub patient_BeforeUpdate(Cancel As Integer)
If Not Me.NewRecord Then
If MsgBox("Changes have been made to the Patient Name" _
& vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes have been Made...") = vbYes Then
DoCmd.RunCommand acCmdSaveRecord
Else
Cancel = True
Me!PATIENT.Undo
End If
End If
End Sub
it is showing error in this line
DoCmd.RunCommand acCmdSaveRecord
so what is wrong with this . any body can help
patient name , and confirm the changes , i will get error in the code
Private Sub patient_BeforeUpdate(Cancel As Integer)
If Not Me.NewRecord Then
If MsgBox("Changes have been made to the Patient Name" _
& vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes have been Made...") = vbYes Then
DoCmd.RunCommand acCmdSaveRecord
Else
Cancel = True
Me!PATIENT.Undo
End If
End If
End Sub
it is showing error in this line
DoCmd.RunCommand acCmdSaveRecord
so what is wrong with this . any body can help