By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

Stop "The open report was cancelled"

P: n/a
I am opening a report (in Preview) from a menu system

I use the following code if there is no data in a report

Private Sub Report_NoData(Cancel As Integer)

MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

End Sub

After this message comes up and is cleared with the OK Button. Access
generates a second annoying message that
"The OpenReport Action was canceled" ( Note Microsoft can't spell
'cancelled' certainly in A2K, but perhaps that is American)

Anyway how do I stop this second message appearing.

Thanks

Phil
Oct 28 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ARC
Well, in code you would check for the err=2501 in your error routine and
simply exit:

Private Sub Report_NoData(Cancel As Integer)
on error goto ErrRtn
MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

Exit Sub
'
ErrRtn:
If Err = 2501 Then 'Open report was cancelled
Exit Function
else
msgbox err.number & " - " & err.description
end if
end sub
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:j8******************************@posted.plusn et...
>I am opening a report (in Preview) from a menu system

I use the following code if there is no data in a report

Private Sub Report_NoData(Cancel As Integer)

MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

End Sub

After this message comes up and is cleared with the OK Button. Access
generates a second annoying message that
"The OpenReport Action was canceled" ( Note Microsoft can't spell
'cancelled' certainly in A2K, but perhaps that is American)

Anyway how do I stop this second message appearing.

Thanks

Phil
Oct 28 '08 #2

P: n/a
ARC
Correction to my last:

The error trapping for 2501 really needs to be on the button that launches
the report. The report will cancel fine, but you get the "open report was
cancelled" in the calling function / button.

Hope this helps,

"ARC" <PC*****@PCESoft.invalidwrote in message
news:Wi***************@nlpi070.nbdc.sbc.com...
Well, in code you would check for the err=2501 in your error routine and
simply exit:

Private Sub Report_NoData(Cancel As Integer)
on error goto ErrRtn
MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

Exit Sub
'
ErrRtn:
If Err = 2501 Then 'Open report was cancelled
Exit Function
else
msgbox err.number & " - " & err.description
end if
end sub
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:j8******************************@posted.plusn et...
>>I am opening a report (in Preview) from a menu system

I use the following code if there is no data in a report

Private Sub Report_NoData(Cancel As Integer)

MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

End Sub

After this message comes up and is cleared with the OK Button. Access
generates a second annoying message that
"The OpenReport Action was canceled" ( Note Microsoft can't spell
'cancelled' certainly in A2K, but perhaps that is American)

Anyway how do I stop this second message appearing.

Thanks

Phil
Oct 28 '08 #3

P: n/a
Thanks "ARC"

Like a clot I checked for error 2501 and insted of exiting. I displayed the
error

Must be going senile

Thanks again

Phil

"ARC" <PC*****@PCESoft.invalidwrote in message
news:8e****************@nlpi070.nbdc.sbc.com...
Correction to my last:

The error trapping for 2501 really needs to be on the button that launches
the report. The report will cancel fine, but you get the "open report was
cancelled" in the calling function / button.

Hope this helps,

"ARC" <PC*****@PCESoft.invalidwrote in message
news:Wi***************@nlpi070.nbdc.sbc.com...
>Well, in code you would check for the err=2501 in your error routine and
simply exit:

Private Sub Report_NoData(Cancel As Integer)
on error goto ErrRtn
MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

Exit Sub
'
ErrRtn:
If Err = 2501 Then 'Open report was cancelled
Exit Function
else
msgbox err.number & " - " & err.description
end if
end sub
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:j8******************************@posted.plus net...
>>>I am opening a report (in Preview) from a menu system

I use the following code if there is no data in a report

Private Sub Report_NoData(Cancel As Integer)

MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

End Sub

After this message comes up and is cleared with the OK Button. Access
generates a second annoying message that
"The OpenReport Action was canceled" ( Note Microsoft can't spell
'cancelled' certainly in A2K, but perhaps that is American)

Anyway how do I stop this second message appearing.

Thanks

Phil

Oct 28 '08 #4

P: n/a
ARC
No problem. Actually I keep wanting to change the "ARC" that shows when I
post, but then people won't know that I posted under a different name (if
that makes sense). Guess it wouldn't matter if I change it?

I hear ya on the simple mistakes. Usually it's the one's staring right out
at ya that you can't see.

Andy
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:98******************************@posted.plusn et...
Thanks "ARC"

Like a clot I checked for error 2501 and insted of exiting. I displayed
the error

Must be going senile

Thanks again

Phil

"ARC" <PC*****@PCESoft.invalidwrote in message
news:8e****************@nlpi070.nbdc.sbc.com...
>Correction to my last:

The error trapping for 2501 really needs to be on the button that
launches the report. The report will cancel fine, but you get the "open
report was cancelled" in the calling function / button.

Hope this helps,

"ARC" <PC*****@PCESoft.invalidwrote in message
news:Wi***************@nlpi070.nbdc.sbc.com...
>>Well, in code you would check for the err=2501 in your error routine and
simply exit:

Private Sub Report_NoData(Cancel As Integer)
on error goto ErrRtn
MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

Exit Sub
'
ErrRtn:
If Err = 2501 Then 'Open report was cancelled
Exit Function
else
msgbox err.number & " - " & err.description
end if
end sub
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:j8******************************@posted.plu snet...
I am opening a report (in Preview) from a menu system

I use the following code if there is no data in a report

Private Sub Report_NoData(Cancel As Integer)

MsgBox "There are no errors in Membership Head of Families",
vbInformation
Cancel = True

End Sub

After this message comes up and is cleared with the OK Button. Access
generates a second annoying message that
"The OpenReport Action was canceled" ( Note Microsoft can't spell
'cancelled' certainly in A2K, but perhaps that is American)

Anyway how do I stop this second message appearing.

Thanks

Phil


Oct 28 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.