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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|