CodeConnect.Net Beta


   Explore    Entry   Register  Login  
windowsxp-general
access
windows-vista-mail
windows-vista-general
windowsupdate
windowsmedia-player
access-forms
windows-live-mail-desktop
windowsxp-help_and_support
access-queries
access-modulesdaovba
access-formscoding
windows-server-sbs
windows-server-general
access-reports
windows-vista-music_pictures_video
windowsce-platbuilder
windows-live-messenger
windows-terminal_services
windows-powershell
windows-server-active_directory
access-gettingstarted
windows-mediacenter
windowsxp-hardware
windowsxp-network_web
windows-64bit-general
windows-live-sync
windows-vista-hardware_devices
windows-inetexplorer-ie6_outlookexpress
windows-group_policy
windows-server-networking
windows-vista-installation_setup
windows-vista-networking_sharing
windowsxp-basics
access-tablesdbdesign
windowsxp-perform_maintain
windows-vista-performance_maintenance
windows-networking-wireless
windows-vista-file_management
windows-inetexplorer-ie6-browser
windows-server-dns
windows-server-update_services
windows-vista-security
windows-vista-administration_accounts_passwords
windows-vista-games
windows-file_system
access-activexcontrol
windows-live-foldershare
windows-live-photogallery
access-developers-toolkitode
access-conversion




Can Reply:  Yes Members Can Edit: No Online: Yes
Zone: > Microsoft News > microsoft.public.access.reports Tags:
Item Type: Date Entered: 11/5/2009 8:47:13 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 124 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
"RipperT" <<RiP
NewsGroup User
Annoying errer message11/5/2009 8:47:13 PM
Reply

0

I have a minor annoyance I'd like to get rid of. I have a button that opens
a report, but if no data is available, then the NoData event kicks in. I
found a nifty trick that cancels error messages with forms but it doesn't
work with this report:

Private Sub Report_NoData(Cancel As Integer)
On Err GoTo Err_Report_NoData

MsgBox " No data to display. ", vbOKOnly + vbExclamation, "No
Data"
Cancel = True

Exit_Report_NoData:
Exit Sub

Err_Report_NoData:
'if action is canceled by user, suppress error msg
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_Report_NoData
End If
End Sub

After user clicks out of the custom msgbox, Access displays this one:
"The OpenReport Action was canceled."
Can I get rid of it?
Thanks,
Ripper


fredg <fgutkind
NewsGroup User
Re: Annoying errer message11/5/2009 10:37:11 PM
Reply

0

On Thu, 5 Nov 2009 15:47:13 -0500, RipperT wrote:

> I have a minor annoyance I'd like to get rid of. I have a button that opens
> a report, but if no data is available, then the NoData event kicks in. I
> found a nifty trick that cancels error messages with forms but it doesn't
> work with this report:
>
> Private Sub Report_NoData(Cancel As Integer)
> On Err GoTo Err_Report_NoData
>
> MsgBox " No data to display. ", vbOKOnly + vbExclamation, "No
> Data"
> Cancel = True
>
> Exit_Report_NoData:
> Exit Sub
>
> Err_Report_NoData:
> 'if action is canceled by user, suppress error msg
> Const conErrDoCmdCancelled = 2501
> If (Err = conErrDoCmdCancelled) Then
> Resume Exit_Report_NoData
> End If
> End Sub
>
> After user clicks out of the custom msgbox, Access displays this one:
> "The OpenReport Action was canceled."
> Can I get rid of it?
> Thanks,
> Ripper

Sure, but you placed the error handling code in the wrong place.
You need to do this in the form code event that you use to open the
report, not in the report itself.

Code the Form event (i.e. a Command Button click event?):

Private Sub CommandName_Click()
On Error GoTo Err_Handler
DoCmd.OpenReport "ReportName", acPreview

Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error# " & Err.Number & " " & Err.Description
End If
Resume Exit_Sub
End Sub

You can remove the error handling completely from the Report's
OnNoData event.

Private Sub Report_NoData(Cancel As Integer)
MsgBox " No data to display. ", vbOKOnly + vbExclamation, "No
Data"
Cancel = True
End Sub

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
2 Items, 1 Pages 1 |< << Go >> >|







Similar:

how can i open ms sqlsharepoint database files

sbs 2003 r2 and vista enterprise - trust relationship

sbs 2008 with a 10gbe card

wsus re-install or fix

migration sbs2003 to sbs2008 error requirements ad

bare metal rebuild of sbs 2003 - advice

sbs 2008 volume shadow copy wont start

where is the script to convert domain computers to sbs computers?

asp.net 2.0

permissions to security center may not be granted to client comput

offline files - an official stance - suitable for general shared f

sbs2003 + isa2004 + iphone query

security event id: 529

help on out of office message in sbs 2003 and exchage

sbs2008 password change prompt

sbs2008 rww activex error

sbs 2003 r2 exchange mx record?

run application as a service under sbs 2008

iis 7 bindings

can someone walk me through?

exchange assistance please

nic hanging issue sms 2003

ethical question

script help needed

sbs 2008 vpn network resources access issue

cert issue on sbs2k3 and entourage 2008

microsoft security essentials

meeting requests not received correctly revisited

smtp problem

cannot migrate sbs 2003 premium to sbs 2008

upgrade sbs 2003 to sbs 2008

sbs 2008 update problem.

accessing our own website sbs 2003 r2

decommissioning exchange server in sbs 2003

prevent user from login to rww>

swing migration

active directory indices rebuilding...

wifi using 802.1x

cannot (re)install server tools on sbs2003

sbs2008 to sbs2008 migration

553 error when sending to a sbs 2008 domain

windows 7 and sbs2k3 r2, any problem when they work together?

error returned while creating the volume shadow copy

ntbackup failing on exchange (sbs2003 r2)

network problems upgrading vista to win 7 on sbs2003

moving data folders for windows small business server 2003

rww "an internal error has occured"

remote access to home user

windows sbs 2008 / 2nd server

sbs 2003 best practices analyzer problem

   
  Privacy | Contact Us
All Times Are GMT