Results 1 to 7 of 7

How to Reference Navigation Subform Objects

  1. #1
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31

    How to Reference Navigation Subform Objects

    I have an Access 2010 database with a navigation subform, but I'm never quite sure how to reference objects in other forms contained with the Navigation Subform. Please help!!

    For example, if:

    frmMain = main form
    NavigationSubform = navigation subform container
    frmEmployees = form contained within NavigationSubform

    How do you reference the following objects in frmEmployees?

    -- a form control
    -- the form object itself to support a method
    -- a subform with frmEmployees

    Here are my best guesses, but I don't think these are correct:

    Form control: Forms!frmMain!NavigationSubform!frmEmployees.Form! txtEmployeeID

    Form itself: Forms!frmMain!NavigationSubform!frmEmployees.Form. Requery

    Subform: Forms!frmMain!NavigationSubform!frmEmployees!subfr mPayments.Form.Recordsource

    Any help would be appreciated!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,485
    See if this helps:

    Forms Refer to Form and Subform properties and controls

    You use the name of the container, not the name of the form within.
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  3. #3
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31
    Thanks, Paul. That was helpful but it didn't quite address the issue because it doesn't go far enough for my application. The example you cited involves a Mainform, Subform1, and Subform2. I need to build a reference that addresses Subform3 as I have a subform within the form that is in the NavigationSubform.

    Any suggestions to define a Recordsource and issue a Requery for this fourth level of subform?

  4. #4
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31
    I figured it out!

    Forms!frmMain!NavigationSubform.Form!subSearchJobs .Form.RecordSource

    or, more generically:

    Forms!Mainform!Subform1.Form!Subform3.Form.RecordS ource

    I guess I'm surprised that Subform2 is not included and I don't understand why not, but it works :-)

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,485
    Glad you got it sorted out. Subform2 must not be involved. In any case, the same pattern would be used, just another level deeper.
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  6. #6
    SmartestIdiot is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    27
    I know this is an old thread, but your post is the closest solution to my problem however I can't seem to make it work.
    Main form = Navigation Form
    Subform = Navigationsubform
    Form = subAwards

    When I try your solution, MS can't find subAwards

    This is what I've tried: Forms![navigation form]![NavigationSubform].Form![subAwards].Form.
    [List370].Requery

    I'm trying to reference the listbox to refresh it. It only is on the subAwards form.

  7. #7
    SmartestIdiot is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    27
    By the way. I can get it to work on just that one form if I take out the [subawards], but then when I go to the other forms I get the debug

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

Similar Threads

  1. Query reference to a subform
    By hawkins in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 09:49 AM
  2. Replies: 1
    Last Post: 05-12-2011, 01:25 PM
  3. form/subform reference problem
    By dbertanjoli in forum Forms
    Replies: 1
    Last Post: 01-10-2011, 01:31 PM
  4. Creating a reference to the subform.
    By evander in forum Forms
    Replies: 2
    Last Post: 05-26-2010, 08:39 AM
  5. Can't reference control in subform
    By evanscamman in forum Forms
    Replies: 0
    Last Post: 12-25-2007, 04:47 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
  •  
Tech Forums: Microsoft Office Forums