S
SG
I have the following behind a list box on a subform but it does not see to be working the vbNo section, if I select No the itemcode which the user typed in should be undone but nothing is happening any ideas anyone??
Private Sub itemcode_NotInList(NewData As String, Response As Integer)
If MsgBox("The Itemcode cannot be found enter now?", _
vbYesNo) = vbYes Then
DoCmd.OpenForm "enter new product details", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
If vbYesNo = vbNo Then
Me.Undo
Cancel = True
Else
Response = acDataErrContinue
End If
End If
End Sub
Many Thanks
S
Private Sub itemcode_NotInList(NewData As String, Response As Integer)
If MsgBox("The Itemcode cannot be found enter now?", _
vbYesNo) = vbYes Then
DoCmd.OpenForm "enter new product details", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
If vbYesNo = vbNo Then
Me.Undo
Cancel = True
Else
Response = acDataErrContinue
End If
End If
End Sub
Many Thanks
S