Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    13

    Question Unanswered: Wildcard Issue in Parameter Query

    I have setup a parameter query that gets the parameter values from a form. On the form, I have a company combo box with three values: DLM, PSI, *. In the query, I have the company field pointing to the combo box on the form. If I choose DLM or PSI on the form, the query works great. However, if I choose *, it does not work (I want it to pull both companies). The syntax I am using is Like [Forms]![frm_Prm_Invoice_List]![Company Prm]. If I run the parameter query and replace this with Like "*" it works fine. I am also using this scenario in another database and it works fine. Am I missing something??

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Did you check what the [Forms]![frm_Prm_Invoice_List]![Company Prm] expression returns? You can also try by using [Forms]![frm_Prm_Invoice_List]![Company Prm].Value.

    By the way, if there are only two possible values why don't you simply drop the WHERE clause in the query when you want it to return all records?

    Have a nice day!

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Because he's not coding it?

    Try this:

    Like "*" & [Forms]![frm_Prm_Invoice_List]![Company Prm] & "*"
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    For more help on programmatically building the SQL string in VBA I'd recommend Martin Green's lectures.
    Me.Geek = True

Posting Permissions

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