Results 1 to 4 of 4
  1. #1
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26

    Multiple cascading combo boxes from single datasheet

    Click image for larger version. 

Name:	1.PNG 
Views:	15 
Size:	15.7 KB 
ID:	27477I'm trying to make cascading combo boxes to narrow down the options for the user on entry. I was able to get the first and second combo boxes to work. here are screenshots of the codeClick image for larger version. 

Name:	3.PNG 
Views:	15 
Size:	2.3 KB 
ID:	27478 for the first combo box named orchard and this is for the secondClick image for larger version. 

Name:	4.PNG 
Views:	13 
Size:	4.8 KB 
ID:	27479. The issue is the third box. I cant get it to filter based on the 2 boxes above it. it only filters based on one of them. Here is the table the data is storedClick image for larger version. 

Name:	2.PNG 
Views:	15 
Size:	59.0 KB 
ID:	27480. Does anyone know what I have to write for it to look at both? Side note I know the other option is to separate the data into multiple tables and build relationships but for the purpose of this database I have to keep the data in one table. Thanks in advance!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    just as you did for cbo2, set cbo3 to look at cbo1 and cbo2, AND the afterupdate event must refresh the list

    cbo3 sql:
    select [field] from table where [orchard]=forms!myForm!cmbOrchard and [commodity]=forms!myForm!cmbCommodity

    but each combo AFTERUPDATE must refresh the next combo down the list
    Code:
    sub cboOrchard_afterupdate()
       cboCommodity.requery
    end sub

  3. #3
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26
    I'm sorry I'm not very good at this. Is this right?
    SELECT [Orchardinfo].[Method] FROM Orchardinfo WHERE (((Orchardinfo.Commodity)=Forms!RecomendationMaker ![cmbOrchard] And [cmbCommodity]=Forms!RecomendationMaker!cmbCommodity)) GROUP BY [Orchardinfo].[Method];

  4. #4
    CRobledo is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    26
    Nevermind I got it! SELECT [Orchardinfo].[Method] FROM Orchardinfo WHERE (((Orchardinfo.Orchard)=Forms!RecomendationMaker!c mbOrchard And [Orchardinfo.Commodity]=Forms!RecomendationMaker!cmbCommodity)) GROUP BY [Orchardinfo].[Method];

    thank you!

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

Similar Threads

  1. Cascading Combo Boxes on a Datasheet...
    By HillChris7714 in forum Forms
    Replies: 7
    Last Post: 09-22-2016, 03:02 PM
  2. Cascading combo boxes in datasheet form
    By gemadan96 in forum Forms
    Replies: 1
    Last Post: 06-20-2014, 09:59 AM
  3. Replies: 4
    Last Post: 10-09-2013, 03:44 PM
  4. Replies: 3
    Last Post: 01-30-2012, 09:43 AM
  5. Cascading combo boxes in datasheet view
    By Hjava in forum Forms
    Replies: 1
    Last Post: 06-28-2010, 06:02 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