Sum in report

Vallan

Registered User.
Local time
Today, 15:06
Joined
Jan 16, 2008
Messages
46
Hi.


Found an earlier thread in the same problem. (No good answer still but i will try to ask again.)


If i have a report wich i search for things that has been registred in the DB by week.

Lets say that one week doesnt have any data registred, then its EMPTY in the report.... not null.

Can i make the sumary to show Zero (0) instead of #Error??

Hope i coukld explain my problem.

Have a nice day.
 
Have you tried setting by default value 0 (zero) in the fields that are being summed?

I'm not sure but may work. This should be done in the settings of the fields in the tables.
 
Last edited:
Well i have that already but if there are no posts during the time period i am looking at in the report then it doesnt matter if i use zero in the table.


To make it easy for me i could enter a post with zeros all the way then i get a zero result in the sumary but thats not so good.


Mattias
 
To make it easy for me i could enter a post with zeros all the way then i get a zero result in the sumary but thats not so good.


Mattias

What else would you expect if you get zero results?:confused:
 
Sorry to confuse.

Trying to explain it better.

I have two tables. 1 for parts we send away and 1 for parts we get to us.

we register every load with what day they where loaded or came.....

I have a report where i see every load weekly....in a subreport i have how muw we have recived......

Then i sum these to get how much we get out in net.... Outgoing - Incoming = Netto

Some weeks we dont have anything incoming and that gets a #Eorror in the sumary because the subreport is empty that particular week.

Hope this makes it easier to understand...
 
Use the HasData method, many examples have been posted here, but by all means post back if you need further help
 
I would like some help if you can.


Have tried to find answer for my problems for weeks....getting greyhaired here. :D

Im gratefull for every help i can get in this case.


And sorry if my english is bad.


Mattias
 
On the main report in the footer add an unbound textbox and set its control source to
=IIf([SubReportName].[Report].[HasData],"SummedSubTextboxName",0)
 
Getting closer to the solution.

Just some "Rookie question.


=IIf([SubReportName].[Report].[HasData],"SummedSubTextboxName",0)


=IIf([Incoming_sub].[Report].[HasData],"Sum_incoming",0)


Is this a correct understanding to your code?


Thanks for your help!!
 
If Sum_incoming is the textbox in the subform footer then yes
p.s. your English is just fine by the way
 
Hmmmm

It is nearly right.


If its no data in a week then i get 0 thats ok.


But now is the problem thé other way.

If i have data in one week then i get the answer #Name?? instead of the correct amount.
 
Here i go again.


I have succeeded so far that i get a zero result if there are no posts.


But when there is posts then i get the text "Sum_incoming" and not the sumary of the values.


:confused:
 
Oops my mistake:o

=IIf([Incoming_sub].[Report].[HasData],[Sum_incoming],0)
 
Trying and trying.


Have read the repport several time to see if i have write correctly.


I only get #Name? as answer when i try the report.
 
Look at the previous post, remove the quotes around "Sum_incoming" and replace them with brackets ie [],[Sum_incoming]
 
Done that.


Sorry...feel like a pain in the ass at you. :(
 
Try =IIf([Incoming_sub].[Report].[HasData],[Incoming_sub].[Report]![Sum_incoming],0)
 
You are a hero!


Thanks for your patience!


Mattias:):D
 

Users who are viewing this thread

Back
Top Bottom