Referring to a control in a subform on a subreport

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • csolomon
    New Member
    • Mar 2008
    • 166

    Referring to a control in a subform on a subreport

    Hello,

    I would like to copy a calculated control of an unbound control on to
    a report. On my form (F_SampleReques t) i have a button which opens
    the report. Here is the code for the button:

    Private Sub btnOpenSampleRe port_Click()

    DoCmd.OpenRepor t "R_SampleReques t"
    'Open Report SampleRequest


    Reports!R_Sampl eRequest.SR_Sam pleReqRep.Repor t!txtRptWat =
    SF_MixSample.Fo rm!ListWater
    Reports!R_Sampl eRequest.SR_Sam pleRequest.Repo rt!txtRptWaterR eq =
    SF_MixSample.Fo rm!txtWaterReqW t

    End Sub

    My report contains a subreport (SR_SampleReqRe p) which has 2 text
    boxes (ListWater and txtwaterReqWt) which I wish to be copied into
    from the SF_mixSample subform. This code prints the report as opposed
    to copying the information into the report. I have used similar code
    to copy from one form to the next, so I thought i could do the same
    with a report and subreport. How can I copy a value from a subform
    to a subreport?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    For all information on referring to form controls check:
    Forms: Refer to Form and Subform properties and controls
    (Much other interesting stuff there!)

    On the other hand, when calculated on a form you could also add the calculation in the (sub)report's query and to transfer is needed.

    Nic;o)

    Comment

    • csolomon
      New Member
      • Mar 2008
      • 166

      #3
      Each of the controls I need are unbound, so I can't refer to them in the query, which is why I just wanted to xfer it.

      That link refers to forms but I need the information related to reports.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Just read for form report and subform subreport :-)

        I do understand that a calculated value is stored in an unbound field, but the calculation will use fields from a table I assume. That calculation can be placed in a query.

        Nic;o)

        Comment

        Working...