Results 1 to 4 of 4
  1. #1
    terryvanduzee is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    17

    Refer to main form

    Hello

    In a subform, is there a way to refer to the parent form without referring to it by name?

    Ex:
    subform name: subform1
    Main form name: Main form 1

    From subform1 is there a way to refer to the main form without explicitly referring to "Main form 1".

    I see there is a "parent", but I can't seem to figure out how to use it.
    If the subform1 is active, I should be able to refer to the main form as Me.parent.cbo_button, but that does not seem to work.

    Thank you
    Terry

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    You are almost there - try this: Me.parent!cbo_button

  3. #3
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Is there any particular reason for wanting to do this? The only one I can think of is having the same subform being used in one or more main forms. But as the subform is loaded before the main form you usually reference controls the other way round, if I am not mistaken.

    David

  4. #4
    terryvanduzee is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    17

    Refer to main form

    Hello

    Thank you, and you are right, I am going to be using the same subform on several forms and I want to refer to the parent so that I do not have to use an if statement to check for each parents' name.

    Thank you

    Terry

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

Similar Threads

  1. copy info in subform as well as main form
    By Coolpapabell in forum Forms
    Replies: 0
    Last Post: 09-30-2009, 10:02 AM
  2. Replies: 1
    Last Post: 09-28-2009, 05:21 PM
  3. Auto Populate Data from Main Form
    By billiejean in forum Forms
    Replies: 0
    Last Post: 08-05-2009, 08:08 AM
  4. Replies: 0
    Last Post: 12-16-2008, 07:49 AM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 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