Results 1 to 4 of 4
  1. #1
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    95

    How do I select the main form when the focus is on the subform?

    This should be simple...but it's proving to be vexing!

    I know the syntax for referring to a control on a subform from the main form is [Forms]![FormName]![SubformName].[Form]![ControlName]. Is there a similar syntax that must be employed to do the reverse, to refer to a control on the main form from the subform? Forms!MainformName!ControlName does not work.

    I've found several references while searching the web for a solution to the Me.Parent.Parent!ControlName syntax, but what I'm looking for is the full syntax that doesn't include the Me., something like [Forms]![MainformName] etc...

    Help would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That syntax should work, but here's a reference:

    http://access.mvps.org/access/forms/frm0031.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    95
    I found the very same page you directed me to while searching. The problem is that I'm using macros and the Me. syntax doesn't work. If you have a form with a subform, give the Forms!MainformName!ControlName syntax a try and you'll see that it doesn't work at all! I was hoping for the reverse of [Forms]![FormName]![SubformName].[Form]![ControlName]

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Forms!MainformName!ControlName will certainly work, and I've used it with many forms with subforms. Can you post the db here? I suspect something isn't what it seems to be.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  2. Replies: 2
    Last Post: 06-26-2012, 10:54 PM
  3. Replies: 1
    Last Post: 02-29-2012, 09:38 AM
  4. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  5. Replies: 1
    Last Post: 12-04-2011, 09:11 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