Hi i have borrowed this code from Nothwind
used in the subform ProductID..it comes up with an error on RunCommand
acCmdUndo
Can anyone advise or give me a better way
DD
Private Sub Form_Error(DataErr As Integer, Response As Integer)
' Errors can occur here if the user has not already selected a
customer for
' this order on the main form. If there is an error and Orders!BillTo
is Null
' inform the user and cancel the entry made in the subform.
If DataErr > 0 Then
If IsNull(Me.Parent!CustomerID) Then
MsgBox "Select a Customer to bill to before entering order
details info."
RunCommand acCmdUndo
Me.Parent!CustomerID.SetFocus
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
End If
End Sub