Results 1 to 5 of 5
  1. #1
    linux_s2002 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    2

    combobox hierarchy

    Hi guys!
    is it possible to have a combo like this?
    Click image for larger version. 

Name:	combobox hierarchy.jpg 
Views:	20 
Size:	20.0 KB 
ID:	51941


    I have 2 tables:
    table1 => id; description that contains (veg, Fruit, eccc)
    table2 => id;descrption; idTable1

    in some case, i have record in table1 but not in table2

    Thank you!!

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    If you prefixed Carrot etc with spaces I would expect you could get that layout.
    Otherwise a treeview might work, though they can be complicated to set up. I have never created one.

    Normally one would use cascading combos.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    Apr 2017
    Posts
    1,792
    tblGroups: GroupID, GroupName; -- group names are like 'Veg', 'Fruit', etc.
    tblProducts: ProductID, GroupID, ProductName --- Product names are 'Carrot', 'Apple', etc.

    You can create a combo box with RowSource property like:
    Code:
    SELECT prod.ProductID, IIf(Nz(group,GroupID,0)=0, "", group.GroupName & ": ") & prod.ProductName AS Product FROM tblProducts prod LEFT JOIN tblGroups group ON group.GroupID = prod.GroupID ORDER BY 2 DESC
    This design allows products with undetermined groups. In case you have a group for every product determined, you can skip the check for GroupID being Null in Rowsource query.

    The selection list the combo will display will be like (all products are grouped by group, in case tis is present):
    Fruit: Apple;
    Veg: Carrot;
    Veg: Eccplant;
    Veg: Potato
    Veg: Pumpkin;
    ...

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    You can create a made up combo using a subform - the subform can then use conditional formatting for the bold and do things like ignore selection of the headings

  5. #5
    linux_s2002 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    2
    Thanks!!! I try it now...

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

Similar Threads

  1. hierarchy problem
    By Bananabender in forum Database Design
    Replies: 16
    Last Post: 09-28-2023, 01:48 PM
  2. Employee Hierarchy
    By skydivetom in forum Access
    Replies: 12
    Last Post: 07-17-2019, 03:56 PM
  3. Creating Hierarchy
    By Just_Some_Guy in forum Access
    Replies: 17
    Last Post: 07-24-2013, 07:06 AM
  4. Using a hierarchy table
    By younggunnaz69 in forum Queries
    Replies: 3
    Last Post: 07-18-2012, 10:11 PM
  5. product hierarchy
    By Lata in forum Access
    Replies: 13
    Last Post: 08-03-2011, 02:56 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