• IN operator Data Mismatch error

    Author
    Topic
    #471188

    Hello. Hope all is well.

    This works
    Private Sub Command109_Click()

    Me.FilterOn = False

    Me.Filter = “[patagon_pedido].[pedidonum] IN (1099, 1100,1101,78)”

    Me.FilterOn = True
    End Sub

    What I really need to do is to get the series in parentheses there from a textbox on the form.

    I think I finally got the syntax errors worked out and arrived at the following but it gives me a data type mismatch error

    Private Sub Command109_Click()
    Dim strControlnums As String
    strControlnums = Me.controlnumlist
    Me.FilterOn = False

    Me.Filter = “[patagon_pedido].[pedidonum] IN (‘” & strControlnums & “‘)”

    Me.FilterOn = True
    End Sub

    Hovering over the code shows that it is picking up the values from the text box correctly.
    Pedidonum is an autonum field..

    Any thoughts?

    Thanks

    Jason

    Viewing 1 reply thread
    Author
    Replies
    • #1240742

      Try this

      Me.Filter = “[patagon_pedido].[pedidonum] IN (” & strControlnums & “)”

    • #1240746

      Ian.

      That did it. Thanks. I had an extra set of single quotes making it be evaluated as text?

      Thanks very much, again.

      Jason Gustafson

    Viewing 1 reply thread
    Reply To: IN operator Data Mismatch error

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: