I have a report that opens in acViewReport from a command button on a form.
When the report shows no data from the underlying query, I want the text "NO DATA" to appear.
Currently I have a label showing "NO DATA" with the Visible property set to No.
In the report's On Current event, I put the following code:
The problem is, it will not show the "NO DATA" until I click on the report.
How do I fix that?
Before clicking on the report.
After clicking on the report.
When the report shows no data from the underlying query, I want the text "NO DATA" to appear.
Currently I have a label showing "NO DATA" with the Visible property set to No.
In the report's On Current event, I put the following code:
Code:
Private Sub Report_Current()
'To show or not show No Data label.
Me.ProjectTitle.SetFocus
If IsNull(GrandTotal) Or GrandTotal = "" Then
Me.lblNO_DATA.Visible = True
End If
End Sub
The problem is, it will not show the "NO DATA" until I click on the report.
How do I fix that?
Before clicking on the report.
After clicking on the report.