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
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