How can I preview a Report with criteria from a subform?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ellis
    New Member
    • Dec 2010
    • 1

    #1

    How can I preview a Report with criteria from a subform?

    well, I have a Form with many pages (tab). On one tab, there is a subform containing a text box that I'd like to reflect the content on the report that a cmdbutton will open.

    See the code:

    rptFamilySurvey Form!Text73=Me! CGuardians_Subf orm!GuardianID

    NB: GuardianID is a text box on the report and I want it to contain exactlly the data which is in Text73.

    And the error message comes: "Microsoft Access can't find the Field "CGuardians_Sub form" reffered to..."

    I don't understand why. So please help me!
  • pod
    Contributor
    • Sep 2007
    • 298

    #2
    I think it is because you have to specify the controls, try something like the following
    Code:
    MnFrmName!frmFldName.Value=Forms!MnFormName.SubFrmName.Controls!SubFrmFldName.Value
    Last edited by pod; Dec 7 '10, 07:53 PM. Reason: better explanation I think

    Comment

    Working...