• Quotes and Strings (Access 2002)

    Author
    Topic
    #438226

    Hello all:
    I’m trying to set up the following criteria in VB and get a type mismatch error. [itemno], , and [description] are text fields in a table. ListItem, ListDesc, and Size are como boxes on a form where I make my choices.

    stLinkCriteria = “[itemno] = ‘ ” & Me! & ” ‘ ”

    As always, any suggestions are appreciated. TIA.

    Viewing 0 reply threads
    Author
    Replies
    • #1044261

      Does the following do what you want?

      stLinkCriteria = "[itemno] = '" & Me! & "'"

      Note that I removed some of the spaces around the single quotes, and some of the double quotes.

      • #1044271

        Hi Hans:

        The error message went away, however, nothing was selected. Copy atached. Thanks again.

        • #1044276

          The ListDesc and ListSize list boxes both have two columns, of which the first one is hidden. This hidden column corresponds to ItemNo and is the bound column. So you end up with a condition looking like

          ... AND [Description] = '201' AND ...

          but of course Description doesn’t have 201 as value. You must change the row source, the column count and column width of the two list boxes so that there is only one column. See attached version.

    Viewing 0 reply threads
    Reply To: Quotes and Strings (Access 2002)

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

    Your information: