Results 1 to 5 of 5
  1. #1
    majoh60 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Posts
    10

    Parameter Query


    Is it possible to have a parameter query that uses multiple values?

    Example: I have a query where the Quarter Field can have values of 1,2,3 or 4. I want to be able to run the query using a combination of any of the quarters (eg. 1 and 2, 1 only, or 1,2,3 and 4) to give me my totals. Is there a way to do this?

    I am very new to Access and I am learning as I go.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    This requires VBA code to construct a criteria string.

    Here is an example that uses listbox http://allenbrowne.com/ser-50.html

    Another approach would be to have 4 checkboxes and construct the string with values that have corresponding checkbox checked.

    Do you also need year in the criteria?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    majoh60 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Posts
    10
    This is way above my level of expertise. I might have to come up with another angle but thanks.








    Quote Originally Posted by June7 View Post
    This requires VBA code to construct a criteria string.

    Here is an example that uses listbox http://allenbrowne.com/ser-50.html

    Another approach would be to have 4 checkboxes and construct the string with values that have corresponding checkbox checked.

    Do you also need year in the criteria?

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You might give this idea a try. So long as the quarters you are looking to return are consecutive, ie. 1-2, 1-3, 1-4, 2-4, then the between function may work.

    Look here: http://www.w3schools.com/sql/sql_between.asp

  5. #5
    Ron99 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    7

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-28-2013, 01:20 PM
  2. Replies: 3
    Last Post: 08-16-2012, 03:02 PM
  3. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  4. Query Parameter!
    By cap.zadi in forum Queries
    Replies: 4
    Last Post: 10-08-2011, 08:00 AM
  5. Parameter Query....
    By Casper2012 in forum Queries
    Replies: 5
    Last Post: 08-16-2011, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums