Reference Parameters in Reports

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

Guest

I have created a report that has the following parameters:
="Period From" & " " & [Enter Start Date] & " " & "Through" & " " & [Enter
End Date]. Everything works OK as long as the report contains data.
However, some months we have empty reports. If the report is empty I get a #
Error where the date range usually appears.
 
I have created a report that has the following parameters:
="Period From" & " " & [Enter Start Date] & " " & "Through" & " " & [Enter
End Date]. Everything works OK as long as the report contains data.
However, some months we have empty reports. If the report is empty I get a #
Error where the date range usually appears.

And what do you want to do if there is no data?

1) Cancel the report copmpletely?
Code the Report's OnNoData event:
MsgBox "There is no data for this period."
Cancel = True

2) Print the report with a label that says there is no data?
Add a label to the report.
Set it's caption to:
"No data this month."
Name it lblNoData
Make the label not visible.
Place it directly on top of the control that will print #error.

Code the Report AfterUpdate event:

lblNoData.Visible = True
ControlName.Visible = False

Make any other report controls not visible at this time if that is
what you want.
 
Back
Top