Switch Forms without Saving

Jason1971

Registered User.
Local time
Tomorrow, 10:13
Joined
Jan 19, 2009
Messages
46
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.
 
Just a suggestion. If the order your controls are completed is important then keep the controls disabled until their order is satisfied. Just my $0.02 :D
 

Users who are viewing this thread

Back
Top Bottom