Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    1

    Unanswered: Referring to subforms???

    Hi,

    This is driving me nuts, I can't do anything on my program until I get this thing working.

    Very simple, one large Mainform. The header of the mainform contains txtMainform. In the detail of the mainform is Subform1, with the text box txtSubform1. In the footer of Mainform is Subform2, with txtSubform2. I would like for the text in txtSubform2 to appear in txtSubform1 and txtMainform. I have used the following syntax:

    Forms![Mainform]![txtMainform] = Me.txtSubform2

    Forms![Mainform]![Subform1].Form.txtSubform1 = Me.txtSubform2

    The first one works, but not the second - it keeps telling me it can't find the field Subform1, with a runtime error 2465, why it thinks Subform1 is a field, I don't know. This is driving me nuts! I have tried so many combinations of things... please help.

    Thanks in advance,
    Brook

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Subforms "have" two names, when used on another form.

    The first name is the name of the suform control, which contains the subform.

    The second name is the name of the form object which is the subform.

    The first name is found in the Name property of the subform control (hereafter referred to as NameProperty).

    The second name is found in the SourceObject property of the subform control.

    When referencing a subform control from another form, the syntax should be:

    forms![frmMain]![NameProperty].form![ControlName]

    Notice, also, the bang after the "form" rather than the period.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •