Report w/ Lots of Totals

  • Thread starter Thread starter Donna Brooks
  • Start date Start date
D

Donna Brooks

I need to run a report w/ lots of totals from different
queries. Could someone please tell me if this is possible
and how to get started?

Thanks in Advance,
Donna Brooks
 
If the totals are mostly unrelated, you can use text boxes with control
sources like:
=DSum("[YourField]","qselYourQuery","YourField = 'SomeValue'")
 
I use temporary tables for most of my reporting.
Sometimes, multiple append queries will feed these
tables. You could feed your various queries into the
temp table, then use the "on format" event to open the
temp table and populate the report.

I use the following code when I open the temp table:

Dim RST As DAO.Recordset
Set RST = CurrentDb.OpenRecordset("Report - P&L Temp
Table", dbOpenDynaset)


Do Until RST.EOF
'put custom code here
RST.movenext
Loop

Good Luck!

Paul
 
I have been trying to select records based on a column value and display the sum in a report. I have tried various syntax, inlduding the one you posted and I simply get "#error" in the value on the report. My syntax is currently =DSum("[amount]","pledge query","record type='P' ") . according to the access documentation you are supposed to put [ ] around the "record type" but that doesnt work either. same result, any suggestion?
 
Jay,
Try open the debug window by pressing Ctrl+G and then enter
?DSum("[amount]","[pledge query]","[record type]='P'")
and press enter.
Do you get the expected result?
Is [Pledge Query] based on a parameter prompt?
Is [Pledge Query] the same as your report's record source?
What is the name of the text box?

--
Duane Hookom
Microsoft Access MVP


Jay Martz said:
I have been trying to select records based on a column value and display
the sum in a report. I have tried various syntax, inlduding the one you
posted and I simply get "#error" in the value on the report. My syntax is
currently =DSum("[amount]","pledge query","record type='P' ") . according
to the access documentation you are supposed to put [ ] around the "record
type" but that doesnt work either. same result, any suggestion?
 
Duanne,

thanks for the info, I put your statement in a query and it worked in the query, the acccess documentation is wrong, you need the [ ] around the source name, in this case [pledge query]. but it still doenst work in the control source of the textbox, (named pledgetotal). one of your questions is,does pledge query have a parameter prompt? yes it does, for date, which it does prompt for. Is this a clue to you as to why it does not work? I tried it without the date prompt and it still didnt work. thanks for your help
 
There is absolutely no way a parameter query will work as the domain in a
function like this.
I never, ever name any object with a name containing a space.
I will ask one more time "Is [Pledge Query] the same as your report's record
source?"

--
Duane Hookom
MS Access MVP


jay martz said:
Duanne,

thanks for the info, I put your statement in a query and it worked in the
query, the acccess documentation is wrong, you need the [ ] around the
source name, in this case [pledge query]. but it still doenst work in the
control source of the textbox, (named pledgetotal). one of your questions
is,does pledge query have a parameter prompt? yes it does, for date, which
it does prompt for. Is this a clue to you as to why it does not work? I
tried it without the date prompt and it still didnt work. thanks for your
help
 
Back
Top