I have Form1, TextBox1 and Subform2, TextBox2. A user incorrectly enters data into TextBox2 before TextBox1. I wish to clean up this mistake and then switch focus to TextBox1. I'm having trouble with the cleanup TextBox2 bit. I am trying the Undo command, which does enable me to switch back to Form1, but then I get the following error msg "Update or CancelUpdate without AddNew or Edit." ??
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const conErrCode = 3314
If DataErr = conErrCode Then
MsgBox ("Which Patient? Please enter the Patient UR.")
Response = acDataErrContinue
DoCmd.RunCommand acCmdUndo
Form_Frm_90Plus_PCI_Data_Entry_Form.UR.SetFocus
Else
Response = acDataErrDisplay
End If
End Sub
Thanks.
Jason.
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const conErrCode = 3314
If DataErr = conErrCode Then
MsgBox ("Which Patient? Please enter the Patient UR.")
Response = acDataErrContinue
DoCmd.RunCommand acCmdUndo
Form_Frm_90Plus_PCI_Data_Entry_Form.UR.SetFocus
Else
Response = acDataErrDisplay
End If
End Sub
Thanks.
Jason.