Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    83

    Unanswered: how to refer to a field in the subreport from the main report

    I want to calculate the percentage for a field in one of my report.
    The report has got a textbox A, and the subreport has got the textbox B. I have to calculate the percentage for a field 'C' which is in the report.
    The value for field C = (Value in fieldA/Value in FieldB)*100

    The problem is I am not sure how to refer the field B in my formula, since it is in the subreport(recordsource for subreport: qryTotal).

    Any clue or idea is really appreciated.
    Thanks in advance.

  2. #2
    Join Date
    Nov 2003
    Posts
    267
    =[REPORTNAME].Report![TEXTBOXNAME]

    This will reference a text box in the sub report.

    Reconginze that if there is ever a time when the sub report may not show (nothing to display) then you will get a #Error as the result.

    S-

  3. #3
    Join Date
    Sep 2003
    Posts
    83
    [QUOTE][SIZE=1]Originally posted by sbaxter
    =[REPORTNAME].Report![TEXTBOXNAME]

    Thanks, I got it.
    In the control source for field C,
    =(fieldA/[Reports]![reportname]![subreportname]![FieldB]) *100

Posting Permissions

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