Results 1 to 15 of 15
  1. #1
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16

    Related Combo Boxes

    Hi,



    How do I get combo2 box to only show related records from what has been selected from Combo1 box?

    Thanks

    Michael

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is called Cascading ComboBoxes or Cascading Lists. Try searching on it. Here's some links to get you started:
    http://www.datapigtechnologies.com/f...combobox2.html
    http://www.fontstuff.com/access/acctut10.htm

  3. #3
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    Thanks RuralGuy,

    I have followed the data pig solution but combo box 2 is always empty, I have checked my query and made sure combo box 1 re-queries combo box 2. Any suggestions?

    Michael

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can you get ComboBox 2 to display a generic list?

  5. #5
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    If I remove the statement whereby I'm looking at the two fields checking if they match I get a list of everything, when I put the criteria in I get nothing.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Meaning nothing matches your criteria. What are you using as a RowSource in ComboBox2 after ComboBox1 has been updated?

  7. #7
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    Do you mean what command (sorry I'm a novice).

    If so I'm using requery for combo box 2:

    Private Sub Combo11_AfterUpdate()
    Combo13.Requery
    End Sub

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In that case, what is the SQL for the RowSource of ComboBox2?

  9. #9
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    SELECT [Package Ids].Package FROM [Package Ids] WHERE ((([Package Ids].[Appeal Description])=forms!source.combo11)) GROUP BY [Package Ids].Package ORDER BY [Package Ids].Package;

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay, then what is the SQL for the RowSource of ComboBox1 and what is the BoundColumn and the ColumnCount?

  11. #11
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16

    Related Combo Boxes

    Rowsource combo box 1:

    SELECT [Appeal Desc].[Appeal ID], [Appeal Desc].[Appeal Desc] FROM [Appeal Desc] ORDER BY [Appeal Desc];

    Bound column = 1

    Column count = 2

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So it looks like you are trying to get records in cbo2 where
    [Package Ids].[Appeal Description] = [Appeal Desc].[Appeal ID]
    ...do you think that will work?

  13. #13
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    No, I'm trying to get records in cbo2 where:
    [Package Ids].[Appeal Description] = [Appeal Desc].[Appeal Desc]
    Isn't that what I'm doing?

  14. #14
    Michael T is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2011
    Posts
    16
    OK, I see it, Thanks for your help!

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help. Happy Turkey day.

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Replies: 3
    Last Post: 10-13-2011, 04:42 PM
  3. Replies: 2
    Last Post: 05-11-2011, 02:58 PM
  4. Using Combo Boxes
    By geoffwbailey in forum Programming
    Replies: 1
    Last Post: 06-21-2010, 10:08 AM
  5. Replies: 1
    Last Post: 01-21-2010, 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