Results 1 to 3 of 3
  1. #1
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150

    Query based on combo boxes and multi-select list box


    I have this report that is based on a query that has parameters from multiple combo boxes in a form. The criteria of the query appear like so,
    Code:
     Like "*" & [forms]![myForm].[comboBox1] & "*"
    It works perfectly fine now. However, I want to include a list box that would allow multiple selections. The list box's bound column is an ID column, which is numeric. How do I retrieve the results of the multi-selected values to a query criteria like I have from the combo boxes?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    Its MUCH easier to build queries by using a single select list box to add items to a 'pick table'. Then the query is a simple join. Zero programming.
    Using multi select list box will take programming skills.

    user dbl-clicks item, run append query
    user deletes an items, run delete query
    Click image for larger version. 

Name:	pick state-lbl.png 
Views:	13 
Size:	34.2 KB 
ID:	25306

  3. #3
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150
    So, in this case where AK, CA, and GA are selected, how do you feed that to a query criteria? In my case, AK, CA, and GA are bounded by associated ID, so the criteria for the query needs to be like 3 or 7 or 15 vs "AK" or "CA" or "GA".

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

Similar Threads

  1. Replies: 3
    Last Post: 04-08-2014, 01:02 PM
  2. Replies: 15
    Last Post: 11-20-2013, 04:30 PM
  3. Replies: 5
    Last Post: 07-26-2012, 12:59 PM
  4. Multi-select List Boxes
    By Rawb in forum Programming
    Replies: 6
    Last Post: 09-21-2010, 09:02 AM
  5. Replies: 1
    Last Post: 03-01-2009, 09:53 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