I have a button that opens a report and in the report I have added a message if there is no records.
How do turn off the message that is produced by access. Is an error handler involved, if so, how and where is it placed to stop the message popping up after the On_Nodata is run.
'button on Main form
On Error GoTo Err_Letters_Click
Dim stDocName As String
stDocName = "rpt4Week"
DoCmd.OpenReport stDocName, acPreview
Exit_Letters_Click:
Exit Sub
Err_Letters_Click:
MsgBox Err.Description
Resume Exit_Letters_Click
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no Tenants that require the 4 week letter", vbOKOnly
Cancel = True
End Sub
How do turn off the message that is produced by access. Is an error handler involved, if so, how and where is it placed to stop the message popping up after the On_Nodata is run.
'button on Main form
On Error GoTo Err_Letters_Click
Dim stDocName As String
stDocName = "rpt4Week"
DoCmd.OpenReport stDocName, acPreview
Exit_Letters_Click:
Exit Sub
Err_Letters_Click:
MsgBox Err.Description
Resume Exit_Letters_Click
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no Tenants that require the 4 week letter", vbOKOnly
Cancel = True
End Sub