Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9060531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:15:13+00:00 2026-06-16T15:15:13+00:00

I have encountered a problem in Access 2010 for Windows: Launch a report using

  • 0

I have encountered a problem in Access 2010 for Windows:

  1. Launch a report using doCmd.OpenReport
  2. Set “Cancel = True” in an event associated with the report
  3. Close Access
  4. Access continues to run as a “phantom” process and must be killed in Task Manager. Access cannot open another database until this process is killed. The task initially shows some CPU utilization but quiets down to 0%.

I discovered this while using doCmd.OpenReport to launch a report. The report opens a form in the Report_Open event. The form prompts the user for report parameters and allows them to press “OK” to display the report or press “Cancel”. The On Click event for “Cancel” sets “Cancel = True”.

It appears that OpenReport() is not responding gracefully to the cancel. This seems like a frequently used technique so I hesitate to call it a bug and am wondering if I am doing something wrong. Actually… the more I explain this, it does sound like a bug. At this point, I am hoping somebody has a workaround or that I am missing something obvious.

This is just a simplified example I created to illustrate the problem:

form

Private Sub Form_Open(Cancel As Integer)
On Error GoTo errHandler

DoCmd.OpenReport "Test Report", acViewPreview, , , acDialog

Exit Sub

errHandler:
Select Case Err.Number
Case 2501   ' Cancelled by user, or by NoData event.
    MsgBox "Report cancelled, or no matching data.", vbInformation, "Information"
Case Else
    MsgBox "Error " & Err & ": " & Error$, vbInformation, "Form_Open()"
End Select
Resume Next

End Sub

report

Private Sub Report_Open(Cancel As Integer)
    Cancel = True
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:15:14+00:00Added an answer on June 16, 2026 at 3:15 pm

    The reason for the problem in this case is acDialog:

     DoCmd.OpenReport "Test Report", acViewPreview, , , acDialog
    

    I think you will find:

     DoCmd.OpenReport "Test Report", acViewPreview
    

    Works without problems.

    Edit re Comment

    You should not need to cancel the report. For the most part, it is better to avoid errors than to trap them, so check for data and get parameters before opening the form. Move the form from the report open event to step of its own and use DLookUp or a query to check for data before launching the form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered an unexpected Access Error while running a project I've built using
I have encountered a problem with creating a thumbnail from an uploaded image file,
I have encountered a problem in one of my Java projects, which causes bugs.
I have encountered a problem twice now whereby a producer thread produces N work
I have encountered a problem of placing data into the Table View. Here is
I have encountered a problem in my application. I have two forms, one that
I have encountered the problem to start different version of jboss in the same
I have encountered this problem today and I don't have an explanation for it.
I am writing a class. I have encountered the problem in the title. Here
I'm currently exploring powershell capabilities, but I have encountered a problem that I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.