> Anyway to bring up a messagebox if a report contains no info?
> Thanks
> DS
Code the Report's OnNoData event:
MsgBox "Sorry, no records to report on."
Cancel = true
The above will generat error 2501 if you have opened the report from
an event.
Trap the error in that event:
On Error Goto Err_Handler
DoCmd.OpenReport "ReportName", acViewPreview
Exit_This_Sub:
ExitSub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error #: " & Err.Number & " " & Err.Description
End If
Resume Exit_This_Sub

Signature
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
DS - 09 Jan 2005 04:24 GMT
>>Anyway to bring up a messagebox if a report contains no info?
>>Thanks
[quoted text clipped - 21 lines]
> End If
> Resume Exit_This_Sub
Great! Thank you, It works!
DS