Results 1 to 2 of 2
  1. #1
    PicoTTS is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    29

    Go To Next Record of Parent Subform

    Hi,

    I currently have a form (parent) with a subform (middle) that has another subform (Child) embedded in it. I am trying to create a button that is on the parent header that changes the middle subform record. The child form is linked to the middle subform.

    I am able to get the middle subform to change between records when the middle or the parent forms have focus. But when I focus on the child subform, my code switches the record in the child form instead of the middle form.

    I am currently using the following:

    Me![Middle Subform].SetFocus
    DoCmd.GoToRecord , , acNext

    I would appreciate the help.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    To be honest, I've never embedded a subform on a subform but if I were to attempt, I'd apply the same syntax logic to refer to a second level subform as I would the first. So try
    Code:
    [Forms]![Main form name]![subform control name].[Form]![subform control name].[Form]![control name on subform]
    (where [subform control name] is the name of the subform control on the parent form and not the subform itself) to drill down to a control on the second subform, or leave off the last control name reference to try drilling down to the second subform level. If you know how to use the Immediate window, you can try that syntax on a known control name to see if it returns the correct value when the form is open. That is, you'd type
    ?[Forms]![Main form name]![subform control name].[Form]![subform control name].[Form]![control name on subform], hit Enter, and see if Access reports resolves the reference. If not, you can try drilling down in stages using this method. Once you drill down to the needed level correctly, you should be able to affect a command on the form.

    Even the incorrect use of the bang operator (!) versus period can cause this to fail, so know that I'm guessing here. The syntax for the normal situation, such as where a control on the subform is being referenced is
    Code:
    [Forms]![Main form name]![subform control name].[Form]![control name on subform]
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-05-2016, 02:32 PM
  2. Replies: 5
    Last Post: 05-27-2014, 02:44 PM
  3. Replies: 1
    Last Post: 04-12-2013, 03:15 PM
  4. Replies: 4
    Last Post: 05-17-2011, 06:56 AM
  5. Replies: 1
    Last Post: 12-22-2010, 01:28 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