M
Max Moor
Hi All,
I have a weird problem I hope someone can help with. I'll describe
the report first, and the problem below.
I have a report used to display receipt information. The sales data
comes from two dissimilar tables, so I display each in a subreport embedded
in the detail section of the main report.
Each subreport has a detail section, and one grouping footer section.
The detail shows info abou the item purchaed, including the amount paid.
The footer section has three text boxes with their control source set to
"=Sum([<amount>])", where <amount> is a disserent field from the
subreport's recordsource query. For what it's worth, one is a simple table
field name, and the other two are calculated in the query.
None of the footer text boxes are set to running sum or anything. I
simply want the total of the values of each of those things in the detail
section. For the sake of discussion, say one of these is called
"txtAmountTotal".
The main report also has a detail section (where the subreports are)
and a single grouping, with a header and footer enabled. The grouping
forces a page break after the section, so I can print multiple receipts for
a single user, if the report is opened with multiple records.
In the grouping footer of the main form, I have a textbox with an
extremely ugly test for its control source. Inside an IIf() function, it
checks if the subreport has data with:
IIf(Reports!rptMainReport!rsub_Purchases.Report.HasData,
If so, It displays the value of "txtAmountTotal" from the subreport or
0 with:
Reports!rptMainReport!rsub_Purchases.Report!txtAmountTotal, 0)
Now the problem...
If I call the main report with a single record, for a single receipt,
this works fine. When I call the report with multiple records, the value
shown on the main report is sometimes wrong. As an example, I have a user
with three receipts, so I open the report with their set of three records.
On the first, the reported value on the main report should be 0, and it is.
On the second one, it should be $175, and it is. On the third one, it
should be 0 again, but it displays $175 still.
I went into the subreport, and made the "totals" boxes in the footer
section visible, and they show the correct values. It's as though, for
that third receipt page, the text box on the main form is still reading the
subreport from receipt (page) 2.
Again, I don't have running totals set anywhere, but it sure acts like
that what it's doing. Does anyone have any thoughts for me?
Thanks, Max
I have a weird problem I hope someone can help with. I'll describe
the report first, and the problem below.
I have a report used to display receipt information. The sales data
comes from two dissimilar tables, so I display each in a subreport embedded
in the detail section of the main report.
Each subreport has a detail section, and one grouping footer section.
The detail shows info abou the item purchaed, including the amount paid.
The footer section has three text boxes with their control source set to
"=Sum([<amount>])", where <amount> is a disserent field from the
subreport's recordsource query. For what it's worth, one is a simple table
field name, and the other two are calculated in the query.
None of the footer text boxes are set to running sum or anything. I
simply want the total of the values of each of those things in the detail
section. For the sake of discussion, say one of these is called
"txtAmountTotal".
The main report also has a detail section (where the subreports are)
and a single grouping, with a header and footer enabled. The grouping
forces a page break after the section, so I can print multiple receipts for
a single user, if the report is opened with multiple records.
In the grouping footer of the main form, I have a textbox with an
extremely ugly test for its control source. Inside an IIf() function, it
checks if the subreport has data with:
IIf(Reports!rptMainReport!rsub_Purchases.Report.HasData,
If so, It displays the value of "txtAmountTotal" from the subreport or
0 with:
Reports!rptMainReport!rsub_Purchases.Report!txtAmountTotal, 0)
Now the problem...
If I call the main report with a single record, for a single receipt,
this works fine. When I call the report with multiple records, the value
shown on the main report is sometimes wrong. As an example, I have a user
with three receipts, so I open the report with their set of three records.
On the first, the reported value on the main report should be 0, and it is.
On the second one, it should be $175, and it is. On the third one, it
should be 0 again, but it displays $175 still.
I went into the subreport, and made the "totals" boxes in the footer
section visible, and they show the correct values. It's as though, for
that third receipt page, the text box on the main form is still reading the
subreport from receipt (page) 2.
Again, I don't have running totals set anywhere, but it sure acts like
that what it's doing. Does anyone have any thoughts for me?
Thanks, Max