Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Empty Reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DS - 09 Jan 2005 03:37 GMT
Anyway to bring up a messagebox if a report contains no info?
Thanks
DS
fredg - 09 Jan 2005 04:05 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.