Supressing NotInList response...

cheuschober

Muse of Fire
Local time
Today, 15:37
Joined
Oct 25, 2004
Messages
168
Looking for a way to supress this message box...
Code:
The text you entered isn't an item in the list.

Select an item from the list or enter text that matches one of the listed items.
... when the NotInList event fires.

Trying to just open an unbound modal form, pass a couple values to it, and set focus on a particular combobox for additional information to be added to my lookup table:

Code:
Private Sub cboPostalCode_NotInList(NewData As String, Response As Integer)

    On Error GoTo Err_ErrorHandler
    
    Const Message1 = "The postal code you have entered is not currently on record."
    Const Message2 = "Would you like to add it?"
    Const Title = "Unknown Postal Code"
    Const NL = vbCrLf & vbCrLf
    
    If MsgBox(Message1 & NL & Message2, vbQuestion + vbYesNo, Title) = vbYes Then
    DoCmd.OpenForm "frmPostalCode"
    Forms!frmPostalCode!cboCountryID = Me.cboCountryID
    Forms!frmPostalCode!txtPostalCode = NewData
    Forms!frmPostalCode.SetFocus
    Forms!frmPostalCode!txtCity.SetFocus
    Else
        Me.cboPostalCode.Undo
    End If
    
Exit_ErrorHandler:
    Exit Sub
    
Err_ErrorHandler:
    MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
    Resume Exit_ErrorHandler

End Sub

Any thoughts?

Regards,
~Chad
 
ahh... simple guess work solved it:

Response = acDataErrContinue... :)
 

Users who are viewing this thread

Back
Top Bottom