Error message displays twice

action

Registered User.
Local time
Tomorrow, 08:34
Joined
May 29, 2003
Messages
89
Below is a sub creates two error messages if there is no data to display on a report. What is the best way of stopping the sub before the second error occurs?

Thanks



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo Err_Detail_Format_Click

If Me.[Payment] = "0" Then
Me.[Payment].Visible = False
Else
Me.[Payment].Visible = True

End If
If Me.[Charge] = "0" Then
Me.[Charge].Visible = False
Else
Me.[Charge].Visible = True

End If

Exit_Detail_Format_Click:
Exit Sub

Err_Detail_Format_Click:
MsgBox "No data for this date available"
Resume Exit_Detail_Format_Click


End Sub
 
Use the NoData event of the report
MsgBox "No data for this date available"
Cancel = True
 
thanks rich, that was easier. Cheers
 

Users who are viewing this thread

Back
Top Bottom