referencing controls in a tab subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trlkaty
    New Member
    • Jun 2007
    • 3

    referencing controls in a tab subform

    I have a form [formA] with a tab control [tab14] with a child [child83] with a subform [subformB] with a button [cmdDoit]. I want to click the button when I enter formA. I can't seem to get the correct reference.
    I've tried
    'Forms![formA].[Form]![subformB].[Form]![cmdDoit]
    Me.[child83].[form]![subformB].[Form]![cmdDoit]
    but it keeps treating subformB as a field.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by trlkaty
    I have a form [formA] with a tab control [tab14] with a child [child83] with a subform [subformB] with a button [cmdDoit]. I want to click the button when I enter formA. I can't seem to get the correct reference.
    I've tried
    'Forms![formA].[Form]![subformB].[Form]![cmdDoit]
    Me.[child83].[form]![subformB].[Form]![cmdDoit]
    but it keeps treating subformB as a field.
    try it this way:
    Forms![formA]![subformB].[Form]![cmdDoit]

    Comment

    • trlkaty
      New Member
      • Jun 2007
      • 3

      #3
      Originally posted by puppydogbuddy
      try it this way:
      Forms![formA]![subformB].[Form]![cmdDoit]
      It gives me the error.
      Run-time error '2465':

      Microsoft Office Access can't find the field 'subformB' referred to in your expression.

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by trlkaty
        It gives me the error.
        Run-time error '2465':

        Microsoft Office Access can't find the field 'subformB' referred to in your expression.
        verify that 'subformB' is the name of the subform control on the main form and not the name of the form object inside the subform control. Thanks.

        Comment

        • trlkaty
          New Member
          • Jun 2007
          • 3

          #5
          Originally posted by puppydogbuddy
          verify that 'subformB' is the name of the subform control on the main form and not the name of the form object inside the subform control. Thanks.
          Thanks, I didn't realize I needed to rename child83 to subformB.

          Comment

          • puppydogbuddy
            Recognized Expert Top Contributor
            • May 2007
            • 1923

            #6
            Originally posted by trlkaty
            Thanks, I didn't realize I needed to rename child83 to subformB.

            You are welcome. I am glad the problem is resolved.

            Comment

            Working...