Results 1 to 3 of 3
  1. #1
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231

    Need to display error message for password protected form.

    I am using the following code to password protect a form.
    Private Sub Form_Open(Cancel As Integer)


    Cancel = (InputBox("PassWord?") <> "Oscar")
    End Sub
    However, I want to be able to display a message when the password is wrong.
    I tried a MsgBox, but that displayed even when the password was correct.
    I am still trying to learn VBA on my own, but it is going slow.
    Please help. Thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    Need an If Then conditional

    If Cancel = True Then MsgBox "something"
    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.

  3. #3
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    That's perfect. Thanks.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-14-2016, 02:18 PM
  2. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  3. Replies: 8
    Last Post: 07-22-2014, 05:58 AM
  4. Display Procedure in Message Box on Error
    By gopherking in forum Programming
    Replies: 1
    Last Post: 01-20-2012, 08:15 AM
  5. Display 'Important Message' On Contiuous Form
    By mseeker22 in forum Forms
    Replies: 35
    Last Post: 06-19-2011, 07:23 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