Results 1 to 4 of 4
  1. #1
    Zalina is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    3

    Parameter Query with several values

    Dear friends,

    could you please tell me how to allow users to query several entries from a table based on ID?

    What I have.
    For the field "ID" the criteria is [Enter ID], i.e. when the query is run, it askes for the ID and shows the entry with this ID.


    What I want.
    To be able to specify IDs that I want to pull out a table, i.e. to print out not one, but 2 or 3 entries based on their ID.

    How can I do it?

    Thank you very much for your help in advance!

    Zalina

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    When you enter the ID numbers, try using "OR". For example:
    22 OR 33 OR 41
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    You can't use "OR", "AND", "IN", ...etc in the query parameter method. I tried and it did not work. If you have 3 ID then you have to use 3 [Enter ID] parameters. Example, [Enter ID 1] OR [Enter ID 2] OR [Enter ID 3].

    There are other ways, but it will require to build form and vba code.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Please show readers the SQL view of your query.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-18-2014, 02:44 PM
  2. How to set Parameter values for a saved query via VBA?
    By lookingforK in forum Programming
    Replies: 8
    Last Post: 07-02-2013, 01:24 PM
  3. Replies: 13
    Last Post: 05-14-2013, 06:01 PM
  4. Parameter Values
    By Darkladymelz in forum Queries
    Replies: 12
    Last Post: 01-19-2012, 08:45 AM
  5. Replies: 4
    Last Post: 01-05-2006, 02:36 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