A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

More summing problems



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2007, 09:38 PM posted to microsoft.public.access.reports
BARRY
external usenet poster
 
Posts: 383
Default More summing problems

I tried to post this earlier and received an error. Sorry if it's double
posted.

I have a report in the form main report with 2 subreports. The subreports
are for customer and prospect calls. Often times there are no prospect calls
made on a particular day. In the footers of each subreport I have a control
that counts the number of records in each of the subreports. There are 2
controls on the main report to show the values of the counts adn reference
the fields in the subreport footers. So long as there are records in both
subreports the fields on the main report are filled in properly. When the
prospect subreport has no records I recieve #error in the field on the main
report. In the main report field I have tried;

IIf(subreport!CountField=0,0,SubReport!CountField) or
IIf(IsNull(SubReport!CountField),0,SubReport!Count Field) and
nz(SubReport!CountField,0) and variations on a theme. Most work as long as
data exists in the subreport.

I have tried to use the On No Data event of the subreport to at least send a
message box to no avail. Additionally, I created a form with a button to
msgbox the value in the footer field and recieve an run-time error'2427': You
entered an expression that has no value.

Any help will be greatly appreciated.

Barry
  #2  
Old August 8th, 2007, 10:14 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default More summing problems

Barry wrote:
I have a report in the form main report with 2 subreports. The subreports
are for customer and prospect calls. Often times there are no prospect calls
made on a particular day. In the footers of each subreport I have a control
that counts the number of records in each of the subreports. There are 2
controls on the main report to show the values of the counts adn reference
the fields in the subreport footers. So long as there are records in both
subreports the fields on the main report are filled in properly. When the
prospect subreport has no records I recieve #error in the field on the main
report. In the main report field I have tried;

IIf(subreport!CountField=0,0,SubReport!CountField ) or
IIf(IsNull(SubReport!CountField),0,SubReport!Coun tField) and
nz(SubReport!CountField,0) and variations on a theme. Most work as long as
data exists in the subreport.



Check the subreport's HasData property.

=IIf(subreport.Report.HasData,subreport.Report!Cou ntField,0)

--
Marsh
MVP [MS Access]
  #3  
Old August 8th, 2007, 10:48 PM posted to microsoft.public.access.reports
BARRY
external usenet poster
 
Posts: 383
Default More summing problems

Dear Marshall:

Most excellent. That seems to work very nicely. I am however a little
confused as to why the nodata event is not triggered. Oh well, life is full
of little mysteries. Thanks very much for your help, it is most greatly
appreciated.

Barry

"Marshall Barton" wrote:

Barry wrote:
I have a report in the form main report with 2 subreports. The subreports
are for customer and prospect calls. Often times there are no prospect calls
made on a particular day. In the footers of each subreport I have a control
that counts the number of records in each of the subreports. There are 2
controls on the main report to show the values of the counts adn reference
the fields in the subreport footers. So long as there are records in both
subreports the fields on the main report are filled in properly. When the
prospect subreport has no records I recieve #error in the field on the main
report. In the main report field I have tried;

IIf(subreport!CountField=0,0,SubReport!CountField ) or
IIf(IsNull(SubReport!CountField),0,SubReport!Coun tField) and
nz(SubReport!CountField,0) and variations on a theme. Most work as long as
data exists in the subreport.



Check the subreport's HasData property.

=IIf(subreport.Report.HasData,subreport.Report!Cou ntField,0)

--
Marsh
MVP [MS Access]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.