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 / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Close Report and Cancel if there are no records.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl Mankat - 28 Oct 2005 05:40 GMT
I found how to do this for forms using RecordsetClone.RecordCount = 0
and using Cancel = True.

How can I do the same thing for a form?

TIA,

Carl

Signature

Wishing you a VERY HAPPY NEW YEAR!!
May it far exceed your expectations.

Marshall Barton - 28 Oct 2005 06:14 GMT
>I found how to do this for forms using RecordsetClone.RecordCount = 0
>and using Cancel = True.
>
>How can I do the same thing for a form?

For a report, use the NoData event:

    Cancel = True

The report will not display, but you will get an action was
cancelled message.  If you opened the report from VBA code
in a form's event procedure, you can trap error 2501 and
ignore the error.  If you need help with this, post the form
procedure that opens the report.

Signature

Marsh
MVP [MS Access]

Carl Mankat - 28 Oct 2005 19:04 GMT
Thanks, I tried that and it gave me what I was after. Will Access Help
give me anything about Cancel?

TIA, again,

Carl

>  
>
[quoted text clipped - 15 lines]
>
>  

Signature

Wishing you a VERY HAPPY NEW YEAR!!
May it far exceed your expectations.

Marshall Barton - 28 Oct 2005 19:43 GMT
Cancel is mentioned in the NoData Event topic in A03, but it
doesn't say any more than setting it to True prevents the
report from printing.

If that's all you do, pretty soon you will notice the pop up
message.  Most people don't want to see this so I Suggested
the way to suppress the message.
Signature

Marsh
MVP [MS Access]

>Thanks, I tried that and it gave me what I was after. Will Access Help
>give me anything about Cancel?
[quoted text clipped - 13 lines]
>>ignore the error.  If you need help with this, post the form
>>procedure that opens the report.
 
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.