Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    3

    Unanswered: Query Criteria based on Control in Combox and Wildcards

    I have a query I want to run where one of the criterion is a value from a combox in a form.

    (I am doing this in the Query builder and not VB, just using SQL so you can see the query)

    SELECT Field1, Field2 FROM MyTable WHERE Field2 = [Forms]![PickThisForm]![SelectCombox]

    My problem is that the data in [SelectCombox] is actually a search string so I need to add a "*" at the end, Right? But ...[SelectCombox] & "*" doesn't work. How do I go about doing this?

    Thanks

  2. #2
    Join Date
    Sep 2004
    Posts
    161
    I dont no but you can try this
    ([SelectCombox] & "*")

  3. #3
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    to use wildcards you should use "LIKE" instead of "=".

    WHERE Field2 LIKE [Forms]![PickThisForm]![SelectCombox] & "*"
    ghozy.

  4. #4
    Join Date
    Sep 2004
    Posts
    3
    Thanks,

    LIKE [Forms]![PickThisForm]![SelectCombox] & "*"

    worked.

Posting Permissions

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