How to get rid of ms access default error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfaisalwarraich
    New Member
    • Oct 2007
    • 194

    How to get rid of ms access default error?

    Hi everybody, im using the following code which is set on Not In List event of a combo box.
    Code:
    Private Sub Combo32_NotInList(NewData As String, Response As Integer)
    Dim strMsg As String
    strMsg = "Value is not in list. Add it?"
    If MsgBox(strMsg, vbOKCancel) = vbOK Then
    DoCmd.OpenForm "Clients", , , , acAdd, acDialog, NewData
    If IsNull(DLookup("ClientID", "Clients", True)) Then
    
    MsgBox "You failed to add a Subcategory that matched what you entered.  Please try again.", vbInformation
    Response = acDataErrContinue
    Else
    Response = acDataErrAdded
    End If
    Else
    Response = acDataErrDisplay
    End If
    End Sub
    I am getting an error message if the value does not match with the values entered in the combo box. "The Text You Entered Is Not Item in the List". Please tell me what how i can get rid of it?
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    Looks like you need to change acDataErrDispla y to acDataErrContin ue

    Else
    Response = acDataErrContin ue
    End If
    End Sub


    Chip

    Comment

    Working...