Results 1 to 11 of 11
  1. #1
    WingerD is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    United States
    Posts
    2

    Cascading combo selection in continuous subform

    For my biology database: I have a main form (species) and a subform (traits). Each trait is identified both by an autonumber index value and a Trait_CODE (8 characters, in sortable order); for each Trait, the user may chose among a number of trait-specific selections. So, if Size is a Trait, Selections may be Very Small, Small, Medium...etc. But for Shape the Selections should be Elongate, Medium, Round,...etc.

    I have set up a sample form with unbound combo boxes to cascade selection values: (1) cboTrait and (2) cboSelection:



    for cboTrait
    SELECT qry_BFId_Traits.Trait_CODE
    FROM qry_BFId_Traits
    ORDER BY qry_BFId_Traits.Trait_CODE;

    > Also in this combo box have an AfterUpdate event:
    Private Sub cboTrait_AfterUpdate()
    CboSelection.Value = Null
    CboSelection.Requery
    End Sub

    for cboSelection
    SELECT qry_BFId_Selections.Selection_SH, qry_BFId_Selections.Trait_CODE
    FROM qry_BFId_Selections
    WHERE (((qry_BFId_Selections.Trait_CODE)=[forms]![Form1]![cboTrait]));

    This works to create cascading selections satisfactorily, in an isolated form with no query associations.

    BUT, I cannot figure out how to connect this to the fields I am trying to fill in my continuous subform query (namely [TraitData_TraitId] and [TraitData_SC_SelectionID]), each of which links to a separate table for reference look-up values.

    As far as i can tell, this combo box example only works (1) when unbound, or (2) when in a main form, controlling all records in subform, but my specific objective is to create separate, cascading selection choices for each row in my continuous subform. How do I do this?

    Sorry, I am sure this is a dumb, oft-repeated question. But I'm brand new to the group and hope I can get some insight.

    Thanks in advance!

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Just about to sign off as its late here in the UK but you may find it useful to look at these examples of cascading combos:
    a) UK postcodes - on my website http://www.mendipdatasystems.co.uk/c...xes/4594455723
    b) Animal classification - FMS website - http://www.fmsinc.com/microsoftacces...cascading.html - apparently this has some flaws

    HTH
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    It appears that in your examples, the combos in question are not on a continuous form whereas I think these are. If that's the case, then I think the latter combos need to get the value of prior combos (or some other field - can't recall which it is at the moment) based on the current record, not on just the selection in the prior combo.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I don't see why it makes any difference whether its a continuous form.
    In fact I have multiple examples where cascading combos are used with continuous forms
    For example, see the Student Target Group Explorer example at: http://www.mendipdatasystems.co.uk/m...ter/4594454290

    This includes 12 combos mostly independent of each other.
    However the tutor group combo depends on the year group. So in the example above it has been filtered to 9BN

    Click image for larger version. 

Name:	StudentExplorer1.PNG 
Views:	27 
Size:	115.1 KB 
ID:	36820Click image for larger version. 

Name:	StudentExplorer3.PNG 
Views:	29 
Size:	95.4 KB 
ID:	36821

    Apologies for the huge images - these are full screen forms
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    on a continuous form
    I meant where the combo is a field in the continuous form records. I'm not seeing any evidence of combos in the records on your pics, not that I can tell if it's a continuous form or datasheet. Yours look like they're in a header?

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    It's a continuous (sub)form. There are no combos in the subform controls.

    However, I've just read post #1 again and now understand why you wrote that.
    Sorry that I missed the point before.

    However, I think what the OP is suggesting makes little sense
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Sorry that I missed the point before.
    All is forgiven, Obi-Wan.
    I do think though that what I'm saying is applicable. It seems that the combos in question are on a csf because
    This works to create cascading selections satisfactorily, in an isolated form with no query associations. BUT, I cannot figure out how to connect this to the fields I am trying to fill in my continuous subform
    To make it work when they're on a csf, you'd use the Current event so that you can get a value of from the "active" (current) record. Not much I can add to this in terms of direction without seeing the db, save to say that [forms]![Form1]![cboTrait] won't work when that control is on a csf. I wouldn't use combos as fields on a csf if I could help it as they're more difficult to deal with.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Think I have done something similar only for search/filter records, not for data entry. I am not quite understanding your implementation.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Micron View Post
    All is forgiven, Obi-Wan.
    LOL. I've been called many things over the years but never that before. I've never seen any of the Star Wars films.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    here is an example which uses cascading combos in continuous forms or datasheets

    https://www.access-programmers.co.uk...d.php?t=275155

  11. #11
    WingerD is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    United States
    Posts
    2

    Thanks, checking it out...

    Quote Originally Posted by Ajax View Post
    here is an example which uses cascading combos in continuous forms or datasheets

    https://www.access-programmers.co.uk...d.php?t=275155
    Thanks for this (and other remarks).

    As some of you have noticed, I am using my continuous form (actually a subform, but I'm not sure that matters in terms of the issue at hand) to build a dataset, in which I want cascading menu choices as I make input selections for new records. I am not using the combo boxes to filter a pre-existing dataset (that would be easier, could rely on unbound boxes). Sorry if in setting up the question I did not state all this clearly.

    So...I have been busy on a different project but will check out the very helpful suggestions provided, and come back if I can't solve my original problem (indeed, I'll come back anyway to verify if successful).

    If I still have problems I'll post an abbreviated database so you can see what I'm trying to do.

    Cheers,
    WingerD

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

Similar Threads

  1. Cascading to Continuous Subform
    By cap.zadi in forum Forms
    Replies: 12
    Last Post: 10-25-2018, 09:24 AM
  2. Replies: 1
    Last Post: 06-06-2018, 03:54 PM
  3. Replies: 2
    Last Post: 09-10-2013, 09:10 AM
  4. Cascading Combo box in Continuous Form
    By neo651 in forum Access
    Replies: 1
    Last Post: 09-15-2011, 02:34 AM
  5. cascading combo boxes in continuous subform
    By ayamali in forum Programming
    Replies: 1
    Last Post: 03-29-2011, 06:33 PM

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