Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quotes and Strings (Access 2002)

    Hello all:
    I'm trying to set up the following criteria in VB and get a type mismatch error. [itemno], [size], 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![list] & " ' "

    As always, any suggestions are appreciated. TIA.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Quotes and Strings (Access 2002)

    Does the following do what you want?
    <code>
    stLinkCriteria = "[itemno] = '" & Me![list] & "'"
    </code>
    Note that I removed some of the spaces around the single quotes, and some of the double quotes.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Quotes and Strings (Access 2002)

    Hi Hans:

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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Quotes and Strings (Access 2002)

    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
    <code>
    ... AND [Description] = '201' AND ...
    </code>
    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.

  5. #5
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Quotes and Strings (Access 2002)

    That did it. Thanks again Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •