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] 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?
The problem is that a subform or subreport with no records returns an error, not a null. So you can either use IsError with an IIf check to return a zero:
Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
When developing Access applications, often we need to know whether an object exists. This article presents a quick and reliable routine to determine if an object exists without that object being opened.
If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…