Subreport error using HasData

K

Kelly

I am creating a rollforward of manufacturing/shipping activity by batch
produced. Right now I have two queries/subreports linked to my main report
to give me a beginning balance and the current period activity. The current
period parameters are populated through a form that contains a Run Report
macro. Everything is operating fine except the totaling of the beginning and
current period activity when there isn't any current period activity.

I am trying to create a hidden field that includes just the current period
activity or converts the lack of activity to zero through the following
control source:

=IIf([SUB Batch Rollforwad 1 Detail].[Report].[HasData],[SUB Batch
Rollforwad 1 Detail].[Report]![AccessTotalsAMOUNT],0)

This works fine on the resulting report until I hit a batch without any
current period activity and then all of the calculations turn to #Name?.

Please let me know if you have any suggestions on what I should be doing to
correct. Thank you in advance for your help with this item. - Kelly
 
K

Kelly

Nevermind - I worked it out using IsError and realizing that different
results occur during Report review on screen and during Print Preview. My
control source now reads as follows:
=IIf(IsError([SUB Batch Rollforwad 1
Detail].[Report]![AccessTotalsAMOUNT]),0,[SUB Batch Rollforwad 1
Detail].[Report]![AccessTotalsAMOUNT])

Also, I have added a command to my report run macro on the input form to
push it to Print Preview.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top