Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to avoid open report action cancelled message (97)

    how to avoid open report action cancelled message box
    what is a graceful way of avoiding the

  2. #2
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how to avoid open report action cancelled message (97)

    never mind, I commented this out next to the button running the report & peace & order was restored to the universe.

    'MsgBox err.Description

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: how to avoid open report action cancelled message (97)

    FYI, you can also use: DoCmd.SetWarnings = FALSE
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Emerald Beach, New South Wales, Australia
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how to avoid open report action cancelled message (97)

    You can also trap the error that occurs. This allows you to get a meaningfull error when something unexpected happens.

    eg surround your code in a procedure with the following.

    at start.
    On Error goto Error_trap

    {code in here)

    Exit_Procedure:
    Exit Sub
    Error_Trap:
    Select case err
    Case 2501'Report open canceled.
    'do nothing, we accept this error.
    Case Else
    msgbox Error,vbInformation,Err & "{procedure Name}"
    end select
    resume Exit_Procedure 'Quit after error.
    This allows you to receive an error description in the msgbox and the error number for trapping if necessary and the procedure where the error occured as the title for the msgbox.

    Never blindly disable error trapping, as the ability to trap errors and deal with thenm is the primary advantage of using vba over macros.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •