#error whne printing a report with no data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I added a text box to the report header with a control source of:

=IIf([HasData]=0, "No Data To Print","")

The code worked great but now I get #error in the detail line for part
number and
report total. How can I fix the #error. I need the report to print for an
audit.
 
Use the IIf() expression with the HasData property in each expression, e.g.:
=IIf([HasData], Sum([Amount]), Null)
 
I am new to MS Access, Can you please look at the code, I still can't get it
to work
=IIf([HasData], Sum([extended cost]), Null, No 41/81 Transactions for
specified date range")

I need a report to still print even though there is no data for audit
purposes.

Allen Browne said:
Use the IIf() expression with the HasData property in each expression, e.g.:
=IIf([HasData], Sum([Amount]), Null)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kathy said:
I added a text box to the report header with a control source of:

=IIf([HasData]=0, "No Data To Print","")

The code worked great but now I get #error in the detail line for part
number and
report total. How can I fix the #error. I need the report to print for
an
audit.
 
What is:
No 41/81 Transactions for specified date range"

IIf has brackets.
Inside the brackets are 3 things separated by commas.
The first is something to test - [HasData] in your case.
The 2nd is what the show if there is data, e.g. a calculation.
The 3rd is what to show if there is no data, typically Null.

The previous example illustrates those 3 things.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kathy said:
I am new to MS Access, Can you please look at the code, I still can't get
it
to work
=IIf([HasData], Sum([extended cost]), Null, No 41/81 Transactions for
specified date range")

I need a report to still print even though there is no data for audit
purposes.

Allen Browne said:
Use the IIf() expression with the HasData property in each expression,
e.g.:
=IIf([HasData], Sum([Amount]), Null)


Kathy said:
I added a text box to the report header with a control source of:

=IIf([HasData]=0, "No Data To Print","")

The code worked great but now I get #error in the detail line for part
number and
report total. How can I fix the #error. I need the report to print
for
an
audit.
 
Back
Top