I'm running Access Project (2000) as a front-end for SQL Server 2000. I have a report based on a stored procedure, which works perfectly.
Right now, when there is no data a message box pops up and says there's no data and the report will be closed. The user then clicks OK and goes on their way.
What I would like to happen is for the report to print and display the "no data" message on the actual printed report.
This is the code on the report, which is functional:
I've tried putting a label in the report's header as well as the detail section that would be visible only if there is no data but it errors out on the Detail_Print event (Error 2427 - You entered an expression that has no value).
I've not been able to find any information on the web or within the forum. Any help or direction would be appreciated.
Right now, when there is no data a message box pops up and says there's no data and the report will be closed. The user then clicks OK and goes on their way.
What I would like to happen is for the report to print and display the "no data" message on the actual printed report.
This is the code on the report, which is functional:
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Const White = 16777215
Const GRAY = 14211288
If (Me![LineNum] Mod 2) = 0 Then
Me![Shading].BackColor = White
Else
Me![Shading].BackColor = GRAY
End If
End Sub
Private Sub Report_NoData(Cancel As Integer)
Cancel = True
MsgBox "No data found! Closing report."
End Sub
I've tried putting a label in the report's header as well as the detail section that would be visible only if there is no data but it errors out on the Detail_Print event (Error 2427 - You entered an expression that has no value).
Code:
Private Sub Report_NoData(Cancel As Integer)
Me!lblNoData.Visible = True
End Sub
I've not been able to find any information on the web or within the forum. Any help or direction would be appreciated.