Results 1 to 5 of 5
  1. #1
    Les W is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3

    dependent comboboxes not allowing choices in the second combobox

    I am having trouble with my drop down list in a second combobox. I have 3 tables as follows:

    Table 1: s, fields: Source _ID(pk), Source _Name
    Table 2: w, fields: Location_ID(pk), Location_Name
    Table 3 (junction table): sw, fields: SW_ Source _ID(pk), SW_Location_ID(pk)

    I have 2 comboboxes on my form: cbo1 and cbo2. Cbo2 is dependent on the value in cbo1.

    Cbo1 has the following RowSource stmt:

    SELECT [s].[Source _ID], [s].[Source _Name] FROM s;

    Cbo2 has a query as the RowSource. The query stmt is:

    SELECT sw. SW_ Source _ID, w. Location_Name
    FROM s INNER JOIN (w INNER JOIN sw ON w.Location_ID = sw. SW_Location_ID) ON s. Source_ID = sw.SW_Source _ID
    WHERE (((s.Source_ID)=[forms]![Form1]![cbo1]));

    Cbo2 will correctly display the drop down list associated with the choice in cbo1. The problem is that no matter which item in the cbo2 item list I choose, cbo2 will only show the first item in the list. For example, if the drop down list is A, B, C, D and I choose item C, item A shows as my choice. What I want is to show S_Name in cbo1 and it’s corresponding list of names as W_Name in cbo2 (which it does) and the ability to choose item B or C or D.

    I do have a Requery AfterUpdate of cbo1, which works fine i.e. the list in cbo2 does change when the cbo1 selection changes.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    check if cbo2.bound column is correct.

    sometimes it will do this.

  3. #3
    Les W is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3
    okay, I had the bound column to 1 and changed it to 2. Now it does give me the choice - thank you. But, in my processing of the contents, I need the Location_ID number, not the name. When I check the value in cbo2 (debug) it does give me the text value of, say 'C'. I think I could now use DLookup to get the value from Location_ID. Is there another way to have cbo2 return the number from field 1? I hope this is clear.

  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

  5. #5
    Les W is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3
    I have no problem when there is a simple relationship between 2 tables. The problem has only come up when there is a many-to-many relationship with a junction table.

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

Similar Threads

  1. Replies: 11
    Last Post: 11-21-2014, 01:17 PM
  2. Replies: 11
    Last Post: 06-19-2014, 09:22 PM
  3. Replies: 8
    Last Post: 04-01-2014, 02:03 AM
  4. Dependent comboboxes and date picker
    By edmscan in forum Forms
    Replies: 4
    Last Post: 03-24-2014, 08:14 AM
  5. Replies: 2
    Last Post: 05-16-2012, 03:10 PM

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