Group:  Microsoft Access ยป microsoft.public.access.setupconfig
Thread: OpenReport command cancels by itself

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

OpenReport command cancels by itself
"Keith" <pqleer[ at ]hotmail.com> 01.03.2006 22:20:11
I have an Access 2000 db with a front end / back end design. All users have
Win2K or WinXP sp2. Database has been running fine for at least a year
(bought the XP machines in Nov 2004). Now on ONE machine ONLY, a
DoCmd.OpenReport command throws an error. My code looks like:

on error resume next
docmd.openreport ...
if err then ...

When I step through the program on that machine, the docmd.openreport
generates an error with err.description = "The OpenReport command was
cancelled"

It makes no sense to me. Could someone help point me in a direction to try?
Or should I just reinstall Access?

Thanks,
Keith


Re: OpenReport command cancels by itself
fredg <fgutkind[ at ]example.invalid> 01.03.2006 22:33:26
On Wed, 1 Mar 2006 17:20:11 -0500, Keith wrote:

[Quoted Text]
> I have an Access 2000 db with a front end / back end design. All users have
> Win2K or WinXP sp2. Database has been running fine for at least a year
> (bought the XP machines in Nov 2004). Now on ONE machine ONLY, a
> DoCmd.OpenReport command throws an error. My code looks like:
>
> on error resume next
> docmd.openreport ...
> if err then ...
>
> When I step through the program on that machine, the docmd.openreport
> generates an error with err.description = "The OpenReport command was
> cancelled"
>
> It makes no sense to me. Could someone help point me in a direction to try?
> Or should I just reinstall Access?
>
> Thanks,
> Keith

That's probably error #2501.
Your report may have a Cancel = True in the OnNoData event which has
fired because your report has no data.
If this is so, then simply change your command button code to:

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

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net