Results 1 to 7 of 7
  1. #1
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28

    subform drop-down dependancies

    Hi



    I have a form which has two drop down menus. One of the menus is based on the result of the first menu and so automatically updates based on that selection. To do this I have used - [Forms]![Form_Name]![Drop_Down_1] for the selection of the second drop down list.

    This works fine and produces the result I want... until I add it to another form as a subform. Is there a trick to get this to work when using the form as a subform? I have tried changing the name of [Form_Name] to the main form name but this hasn't worked either.

    Any help in this would be very much appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    instead of [Forms]![Form_Name]![Drop_Down_1]

    use
    Parent.[Drop_Down_1]

  3. #3
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28
    Hi Ajax

    Unfortunately this hasn't worked. when I click on the drop down it asks me to 'enter the parameter value' for [Drop_Down_1].

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    until I add it to another form as a subform
    you'd better clarify what you mean by 'it'. I assumed it meant from 'One of the menus is based on the result of the first menu' you meant the 'one of' menu

  5. #5
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28
    I have created a form called 'frmAppType'. I wish to include this form in the main form, called 'frmNewApp', as a subform. When using 'frmAppType' as a stand alone form it works fine and the drop down menus act as expected. Drop_Down_2 is limited based on what is selected in Drop_Down_1. However, once I add 'frmAppType' to 'frmNewApp' as a subform it no longer works. Drop_Down_1 works fine, but Drop_Down_2 is blank - which is not what I want.

    Does that help clear it up?

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    OK, so both dropdowns are on the same form

    In which case you do not refer to the forms collection but to the me collection. The reason your code stopped working is that a subform is not part of the forms collection - it is a subform control on the main form

    i.e.

    me.[Drop_Down_1]

    or just

    [Drop_Down_1]

  7. #7
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28
    Excellent, thanks Ajax.

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

Similar Threads

  1. Replies: 16
    Last Post: 04-06-2014, 05:56 PM
  2. Web DB Subform drag&drop doesnt work
    By Stefan in forum Forms
    Replies: 6
    Last Post: 11-27-2012, 01:42 PM
  3. Replies: 3
    Last Post: 12-30-2011, 01:20 PM
  4. Replies: 3
    Last Post: 11-29-2011, 07:01 AM
  5. Replies: 1
    Last Post: 05-29-2008, 04:27 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