Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Cancel = True without the Access notification

    Code:
    Private Sub Report_NoData(Cancel As Integer)
    MsgBox "No checks were found recorded for week " & Me.OpenArgs
    Cancel = True
    End Sub
    The message displays as expected and the report closes but I can't get that action to take place without Access "telling me the action was cancelled". What else do I need?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Error trapping in the code that calls the report. It will throw a 2501 error, which since you have a message already you just have it resume with the exithandler.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks Paul. I'm scratching my head as to why I haven't hit this before. Memory really in the tank these days so I guess I shouldn't be surprised.

    I have a lot of extra snow if you're running out?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem Bill. Feel free to bring as much snow as you can fit in your car.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Notification in access?
    By Xterra14s in forum Access
    Replies: 3
    Last Post: 08-09-2016, 03:59 PM
  2. Replies: 8
    Last Post: 10-06-2014, 03:02 PM
  3. Replies: 5
    Last Post: 05-27-2014, 02:44 PM
  4. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM
  5. Replies: 0
    Last Post: 03-11-2012, 09:19 AM

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