Results 1 to 3 of 3
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Cancelling a Report in the Middle of Running It

    I have a report that prompts the operator to change printer forms based on the process of a report. Currently, I put up an OkOnly msgbox to "Change the Form to xxx, etc.". I want to give the operator another option using an OkCancel type msgbox where if she clicks on Cancel, the report terminates. I tried using a docmd.close, but I got a runtime error stating "This action can't be carried out while processing a form or report event." I currently have the code in the GroupHeader0_Print event. Any help would be appreciated.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What factors determine which form is used?

    I suggest you analyze whatever the process is BEFORE you send the print job to cue. After you send the print job to spool it is in the printer's hands and out of the control of your application. You might be able to write code that would access the properties of the printer and cancel a job that has been sent to the printer.

    You might be able to access the Printer's properties and tell the printer which tray to use before sending the print job to the printer.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    MsgBox popup can take one of two forms.

    1. simple message with only OK button as response
    MsgBox "This is my message"

    2. a function that can offer multiple response buttons
    If MsgBox("This is my message", vbOkCancel) = vbOK Then
    'code to print report
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Parsing Middle of String
    By OprEowyn in forum Queries
    Replies: 4
    Last Post: 02-20-2013, 10:53 PM
  2. Replies: 3
    Last Post: 05-08-2011, 12:55 PM
  3. More than one middle name
    By vorstopzolder in forum Access
    Replies: 5
    Last Post: 02-10-2011, 01:09 AM
  4. Cancelling the NotInList event
    By Remster in forum Programming
    Replies: 12
    Last Post: 11-21-2010, 10:12 AM
  5. Cancelling a query
    By P5C768 in forum Queries
    Replies: 0
    Last Post: 09-11-2009, 04:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums