Results 1 to 2 of 2
  1. #1
    Pavlina is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2015
    Posts
    1

    2 Combo Boxes (multivalued fields): the 2nd should not display values if already selected in the 1st

    Hello, I appreciate your help with this scenario.

    Scenario


    I have a form with two combo boxes that have the same source table. Multiple values are allowed (I know this is normally not advisable, but in this specific case this is what we have).
    What I want is that if certain values are selected in the first combo box, then they are not anymore available in the second.

    Example:

    Form [Customers]

    Combo1


    Control Source [Daily_Services]
    Row Source table [Services]
    "Service A"
    "Service B"
    "Service C"
    "Service D"
    "Service E"
    "Service F"

    Combo2
    Control Source [Weekly_Services]
    Row Source table [Services]
    "Service A"
    "Service B"
    "Service C"
    "Service D"
    "Service E"
    "Service F"

    What I would need is for Combo2 to have as source a query that from [Services] EXCLUDES those already selected from Combo1 in that record. For example

    If from Combo1 were selected as [Daily_Services]:
    "Service A"
    "Service C"


    Then I want Combo2 to display as only available values for [Weekly_Services]:
    "Service B"
    "Service D"
    "Service E"
    "Service F"

    And NOT to show "Service A" and "Service C" because they were already selected as [Daily_Services]

    What I tried
    I tried using a query as source for Combo2, with a criteria
    NOT LIKE [Forms]![Customers]![Daily_Services]
    This works only if there was a single value selected in Combo1 but it does not work if multiple values are selected. I tried both using as Source from [Services] the numerical ID and the actual text value.

    Can you please help me to figure this out? I tried lots of complicated queries and SQL but I think I am complicating things when hopefully the solution is much simpler! Thanks a lot!

  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
    52,902
    I doubt the solution will be simple.

    I don't use multi-value fields. I suspect the 2nd combobox RowSource will have to be a query that includes the 1st multi-value field in a query that expands the multiple values to individual records.

    https://support.office.com/en-US/Art...n-US&ad=US#bm7
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-02-2015, 03:23 AM
  2. Calculating sum of selected option/combo boxes
    By SgtSaunders69 in forum Forms
    Replies: 4
    Last Post: 08-04-2014, 09:20 PM
  3. Replies: 6
    Last Post: 07-03-2014, 02:32 PM
  4. Replies: 4
    Last Post: 10-06-2012, 11:57 AM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

Tags for this Thread

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