Using A2K. I've got a combo box that if an item is entered that isn't
in the lookup table, the user is prompted whether or not they want to
add it to the list. If "No", I want the value to stay in the field
but not be added to the list. The message that the item isn't in the
list displays after "No" is chosen. How do I suppress this message?
I managed to get past the message with the following code but I'd like
to suppress the message all together. By "...get past..." I mean I
can tab out of the field the NotInList message won't display anymore.
Any help or advice is appreciated.
strTitle = conQuote & NewData & conQuote & " not in Payee list"
strMsg = "Do you wish to add it to the list?"
If MsgBox(strMsg, vbYesNo, strTitle) = vbYes Then
DoCmd.OpenForm "frmPayee", , , , , acDialog, Me.cboPayee.Text
If IsLoaded("frmPayee") Then
Set frm = Forms!frmPayee
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tlkpPayee", dbOpenTable)
With rst
.AddNew
!Payee = frm!txtPayee
!Address = frm!txtAddress
!SSN = frm!txtSSN
.Update
End With
Response = acDataErrAdded
Me.txtPayeeAddress = frm!txtAddress
Me.txtSSNTaxID = frm!txtSSN
DoCmd.Close acForm, "frmPayee"
rst.Close
dbs.Close
Else
Response = acDataErrContinue
End If
Else
Me.cboPayee.LimitToList = False
Response = acDataErrAdded
End If