Results 1 to 2 of 2
  1. #1
    Reaper is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    57

    Suppressing Access messages

    I have some code that runs on a Form_Open event. The code opens a password form then continues with the form_open if it matches. If it does not match it cancels the form_open.

    When the form_open is cancelled I get a message from Access, "OpenForm action was cancelled". I'd prefer not to see this message. Is there a way to suppress this?

    I've already tried docmd.setwarnings false. Doesn't help.

    Here is the code:

    If Not (rs![KeyCode] = MyPassword) Then
    MsgBox "Sorry you entered the wrong password." & _
    "Try again.", vbOKOnly, "Incorrect Password"


    Cancel = True
    End If

  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,518
    You need to trap for the error in the code that opens the form:

    http://www.baldyweb.com/ErrorTrap.htm
    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. Suppressing a msgbox
    By alphabetsoup in forum Forms
    Replies: 3
    Last Post: 10-04-2011, 10:30 AM
  2. Custom messages to Access' default error messages.
    By evander in forum Programming
    Replies: 1
    Last Post: 06-26-2010, 02:06 AM
  3. Suppressing #Name? Error
    By Jess_Wundring in forum Programming
    Replies: 2
    Last Post: 04-15-2010, 12:43 AM
  4. Replies: 3
    Last Post: 10-15-2009, 12:24 PM
  5. SENDING EMAIL MESSAGES DIRECTLY FROM ACCESS
    By Frenchos in forum Access
    Replies: 0
    Last Post: 07-20-2007, 12:51 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