I'm using the following code in a Not In List on cboReferralID combo box. If the name is not on the combo list then I want frmReferral to open, which it does, take the New Data from the combo box and put it in the name fields, which it does, then update the combo box list with new record, which it does but what I haven't been able to keep it from doing is firing off the Not In List Access message. Could someone please lend a hand and help out with this problem. Many thanks ahead of time.
Dim varNData As Variant
varNData = NewData
Dim intmsgresp As Integer
intmsgresp = MsgBox("The Referral you entered is not on our list." & vbCrLf & vbCrLf & "Would you like to add it?", _
vbYesNo + vbQuestion, "Referral Is Not On Our List"
If intmsgresp = vbYes Then
DoCmd.OpenForm "frmReferral", acNormal, , , acFormAdd, acDialog, varNData
Me.cboReferralID.Undo
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Dim varNData As Variant
varNData = NewData
Dim intmsgresp As Integer
intmsgresp = MsgBox("The Referral you entered is not on our list." & vbCrLf & vbCrLf & "Would you like to add it?", _
vbYesNo + vbQuestion, "Referral Is Not On Our List"
If intmsgresp = vbYes Then
DoCmd.OpenForm "frmReferral", acNormal, , , acFormAdd, acDialog, varNData
Me.cboReferralID.Undo
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If