+ Reply to Thread
Results 1 to 5 of 5

MS Query - Parameters

  1. #1
    Registered User
    Join Date
    05-08-2008
    Posts
    35

    MS Query - Parameters

    Hi

    Is it possible to set parameters on a query but use a wildcard to return all instances? I have a query that I want to be able to set multiple parameters on but give the user the ability to select as many or as few parameters as they want to see. 2 of the parameters are number fields and 2 are text fields with no spaces.

    Thanks

    Matt
    Last edited by mattydalton; 11-17-2009 at 11:49 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: MS Query - Parameters

    Can you elaborate?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-08-2008
    Posts
    35

    Re: MS Query - Parameters

    If a user wants to define only one of the parameters (for example the year in which a portfolio was bought) but wants to leave the others blank (for example the name of the client, portfolio ID and a category) then the data returned will be for all clients, all portfolios and categories but puchased in the specified year. Likewise, the user might want to return data for a specific client irrespective of the other parameters.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: MS Query - Parameters

    In the MSQuery application set all your paremeters with the Like[] condition

    e.g

    Like [Client]

    when you close the Query fill in the parameter input boxes with a temporary filter item...

    then in the sheet, say use input cells for your users to input desired filter criteria..

    Then use other cells somewhere else in sheet to reference these cells respectively and enter formulas like: ="%"&A1&"%" where A1 is a cell that user inputs his/her parameter.

    Then right-click on the query output and select Parameters

    Select one parameter from the left pane and then select "Get the value from the following cell" and enter the cell where you put the above formula.

    Check the "Refresh automatically when cell value changes checkbox".

    Repeat for each parameter.

    Click Ok and test by entering desired parameters in any/all input cells.

  5. #5
    Registered User
    Join Date
    05-08-2008
    Posts
    35

    Re: MS Query - Parameters

    Sorted, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1