I am using VB code to print reports from a main menu. The problems is whenever I do not complete the printing of a report, such as On No Data, I get a Microsoft Message that says the OpenReport Action was canceled. I do not want this message to show. My users are just going to get confused. How to I disable this??
Thanks
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Microsoft Access Messages (Access 97 SR2)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Microsoft Access Messages (Access 97 SR2)
- This topic has 7 replies, 6 voices, and was last updated 23 years, 6 months ago.
AuthorTopicWSCathyKnoll
AskWoody LoungerOctober 16, 2001 at 1:50 pm #361587Viewing 2 reply threadsAuthorReplies-
WSThomasW
AskWoody Lounger -
WSCathyKnoll
AskWoody Lounger -
WSRupert
AskWoody Lounger -
WSgarbsmj
AskWoody LoungerOctober 16, 2001 at 6:38 pm #547082This is a bit of VBA code that we put on all our reports. Then no matter what you use (VBA, macro, standalone), you’ll get a little message if there isn’t any data. If you need to build this into VBA, let me know and I’ll try to explain how to do that.
Private Sub Report_NoData(Cancel As Integer)
‘ Display a message if there are no records for the report,
‘ and don’t preview or print report.MsgBox “There is no data for this report.”, , “No report Data”
Cancel = TrueEnd Sub
Hope this helps –
-
-
WSDouglas Martin
AskWoody LoungerOctober 16, 2001 at 9:14 pm #547126-
WSCathyKnoll
AskWoody Lounger
WSRichP
AskWoody LoungerOctober 16, 2001 at 11:26 pm #547142I was frustrated the same way. What I finally found the problem to be was the form that was calling the report neded the error handling. And rather than display any message as a result of this error, I chose to simply Resume processing. The code snipet below would be on the form’s button…
Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click(do what ever here…)
Err_cmdReport_Click:
Resume Exit_cmdReport_Click
End SubI always provide a simple message to the user when no data are available. But I do it in the On No Data event of the form…
Private Sub Report_NoData(Cancel As Integer)
MsgBox “There is no data to print in this report.@ Please change your settings and try again.@Printing will be cancelled.”, , “No Data to Display…”
Cancel = True
End SubHope this helps!
Regards,
Rich P.
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Network Issue
by
Casey H
1 hour, 21 minutes ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 hours, 31 minutes ago -
May 2025 Office non-Security updates
by
PKCano
4 hours, 57 minutes ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
6 hours, 53 minutes ago -
pages print on restart (Win 11 23H2)
by
cyraxote
6 hours, 8 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
9 hours, 4 minutes ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
9 hours, 6 minutes ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
16 hours, 27 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
49 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
1 day, 3 hours ago -
How much I spent on the Mac mini
by
Will Fastie
3 hours, 13 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
4 hours, 59 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
1 day, 9 hours ago -
Setting up Windows 11
by
Susan Bradley
4 hours, 43 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
1 day, 5 hours ago -
Powershell version?
by
CWBillow
1 day, 6 hours ago -
SendTom Toys
by
CWBillow
2 hours, 34 minutes ago -
Add shortcut to taskbar?
by
CWBillow
1 day, 9 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
2 days, 2 hours ago -
How can I install Skype on Windows 7?
by
Help
2 days, 1 hour ago -
Logitech MK850 Keyboard issues
by
Rush2112
1 day, 7 hours ago -
We live in a simulation
by
Alex5723
2 days, 16 hours ago -
Netplwiz not working
by
RetiredGeek
2 days, 3 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
3 days, 4 hours ago -
Microsoft is killing Authenticator
by
Alex5723
6 hours, 43 minutes ago -
Downloads folder location
by
CWBillow
3 days, 11 hours ago -
Remove a User from Login screen
by
CWBillow
2 days, 6 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
3 days, 2 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
3 days, 2 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
1 day, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.