R
Ray S.
I have a report that has this code in it
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Cost_Center.Value = "30000" Then
text71404501.Visible = False
Else
text71404501.Visible = True
End If
End Sub
The report is selected to run from a button on a form.
My problem is that if the report has no data, the code returns run-time
error 2427 informing me that an expression has no value. When I debug it goes
to the IF statement above. What code can I add so I'll just get a dialog
informing the user that there is no data and on OK, then canceling the action?
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Cost_Center.Value = "30000" Then
text71404501.Visible = False
Else
text71404501.Visible = True
End If
End Sub
The report is selected to run from a button on a form.
My problem is that if the report has no data, the code returns run-time
error 2427 informing me that an expression has no value. When I debug it goes
to the IF statement above. What code can I add so I'll just get a dialog
informing the user that there is no data and on OK, then canceling the action?