Results 1 to 12 of 12

Thread: Reports (A2K)

  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reports (A2K)

    Greetings: I have a report, rpt_Combined_Report, that consists of 3 subreports. Each subreport calculates a total number of hours. The subreports are each based on a separate query. What I would like to do is calculate a grand total of hours, using each subreports calculation. The names of the subreports and total controls are as follows:

    rpt_EMT_Refresher![Total Time]
    rpt_CME_Totals![Sum of Hours]
    rpt_Run_Review![Sum of NewTime]

    I tried this: =rpt_Combined_Report!rpt_Emt_Refresher![total time]+rpt_Combined_Report!rpt_CME_Totals![sum of hours]+rpt_Combined_Report!rpt_Run_Review![sum of newtime]

    The result that I got was #Name?

    Any and all assistance is greatly appreciated. TIA.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports (A2K)

    Check carefully that the names you use are those of the subreports as controls on the main report. They are not necessarily the same as those of the subreports in the database window.
    Open the main report in design view, and click once on one of the subreports. You'll see the control name in the caption of the Properties window, and of course in the Name property.
    Also check carefully that you are using the correct names for the controls on the subreports displaying the total time.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Reports (A2K)

    What happens when you change the ! to a . after the name of the main report name (the main report name I assume is rpt_Combined_Report)? Something like:

    =rpt_Combined_Report.rpt_Emt_Refresher![total time]+rpt_Combined_Report.rpt_CME_Totals![sum of hours]+rpt_Combined_Report.rpt_Run_Review![sum of newtime]

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    Pat and Hans: Thanks for your quick replies. I did as both suggested but to no avail. The names were all correct and whether I use the ! or the . made no difference. I will keep plugging away at this. The controls, [sum of hours], [sum of newtime] and [total time] are calculated controls on the subreports. This may be the reason I am experiencing difficulty. Thanks again.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports (A2K)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  6. #6
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    Hans: Here it is. Use frm_CME_Report to initiate the report. I have been using b027, a003 as the IDs. Thanks again.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports (A2K)

    The control source of the Grand Totals text box should not mention the main report itself. Moreover, total_time is on the rpt_Emt_Refresher subreport of the rpt_CME_Totals subreport. So the control source should be:

    =rpt_CME_Totals!rpt_Emt_Refresher![total time]+rpt_CME_Totals![sum of hours]+rpt_Run_Review![sum of newtime]

  8. #8
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    Hans: Thanks again for the tips and the solution. Works fine.

  9. #9
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    One thing I overlooked and it just reared its ugly head, is how to handle the calculation if a subreport has no data. If you could assist me with this, I would be most appreciative. TIA.

  10. #10
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    <P ID="edit" class=small>(Edited by Francois on 09-Sep-05 17:46. Remove a 0 that was to much)</P>You can use the IsError function:

    =IIF(IsError(rpt_CME_Totals!rpt_Emt_Refresher![total time]),0,rpt_CME_Totals!rpt_Emt_Refresher![total time])+IIF(IsError(rpt_CME_Totals![sum of hours],0,rpt_CME_Totals![sum of hours])+IIF(IsError(rpt_Run_Review![sum of newtime],0,rpt_Run_Review![sum of newtime])
    Francois

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports (A2K)

    Another possibility is to use the HasData property of the subreports:

    =IIf(rpt_CME_Totals!rpt_Emt_Refresher.Report.HasDa ta,rpt_CME_Totals!rpt_Emt_Refresher![total time],0)+IIf(rpt_CME_Totals.Report.HasData,rpt_CME_Tota ls![sum of hours],0)+IIf(rpt_Run_Review.Report.HasData,rpt_Run_Revi ew![sum of newtime],0)

  12. #12
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (A2K)

    Francois & Hans:

    Thanks for both solutions. Both worked. I can enjoy my weekend and hope you both do the same. Thanks again.

Posting Permissions

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