Annu
asked on
Test for no-value in control
I have a report with 2 sub-reports. The report is a customer statement between 2 dates showing his/her orders and payments.
One sub-report shows all orders between the 2 dates, and the other sub-report shows all payments between the 2 dates. On each sub-report there is a non-visible control which is the sum of orders (or payments).
This non-visible control is used to supply the total orders and payments values to controls on the main report.
The controls on the main report have control source as:
=[sbrOrders].Report![txtSu mOrders] and
=[sbrPayments].Report![txt SumPayment s].
[sbrOrders] and [sbrPayments] are the names of the 2 sub-reports. [txtSumOrders] and [txtSumPayments] are the non-visible controls.
A problem occurs when there are no orders (or payments) between the 2 dates. There is no value in the total control on the main report, not even Null.
How do I test for this situation so that I can run alternative code?
Thanks.
One sub-report shows all orders between the 2 dates, and the other sub-report shows all payments between the 2 dates. On each sub-report there is a non-visible control which is the sum of orders (or payments).
This non-visible control is used to supply the total orders and payments values to controls on the main report.
The controls on the main report have control source as:
=[sbrOrders].Report![txtSu
=[sbrPayments].Report![txt
[sbrOrders] and [sbrPayments] are the names of the 2 sub-reports. [txtSumOrders] and [txtSumPayments] are the non-visible controls.
A problem occurs when there are no orders (or payments) between the 2 dates. There is no value in the total control on the main report, not even Null.
How do I test for this situation so that I can run alternative code?
Thanks.
Opps..
=iif(isnull([sbrOrders].Re port![txtS umOrders]) =true;0;[s brOrders]. Report![tx tSumOrders ])
and
=iif(isnumeric([sbrOrders] .Report![t xtSumOrder s])=true;0 ;[sbrOrder s].Report! [txtSumOrd ers])
=iif(isnull([sbrOrders].Re
and
=iif(isnumeric([sbrOrders]
Or use something like
If nz(sbrOrders.Value) > 0 Then
Process
Else
Nothing there
End if
If nz(sbrOrders.Value) > 0 Then
Process
Else
Nothing there
End if
Have you tried the 'On No Data' evnt in the Report?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
=iif(isnull([sbrOrders].Re
or like this
=iif(isnumeric([sbrOrders]