Results 1 to 2 of 2
  1. #1
    paramjotsingh is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Feb 2012
    Location
    Toronto
    Posts
    1

    Command Button Security

    I developed some database and I put the password on the delete command button. So in order to delete we have to enter password. But I am unable to apply on Save Command Button.. Any other technique ?

    Code for Password Delete Button:

    Private Sub Delete_Click()
    Dim strPassword
    strPasswd = InputBox("Enter Password", "Restricted Access")
    If strPasswd = "" Or strPasswd = Empty Then
    MsgBox "No Input Provided", vbInformation, "Required Data"
    Exit Sub
    End If
    If strPasswd = "ESWErase" Then
    Me.Recordset.Delete
    Else
    MsgBox "Sorry you do not have access to override", _


    vbOKOnly, "Important Information"
    Exit Sub
    End If
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    The criteria of "" and Empty appear to be the same thing - an empty string. If you want to handle null, use:

    If strPasswd & "" = "" Then

    Is this a command button on a form? Why won't the Save work - error message, wrong results, nothing happens?
    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. Button Command
    By JayX in forum Access
    Replies: 7
    Last Post: 12-27-2011, 12:58 PM
  2. Command Button
    By tia in forum Access
    Replies: 1
    Last Post: 11-20-2011, 11:47 AM
  3. Command Button
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-02-2011, 04:47 PM
  4. command button
    By berni3883 in forum Forms
    Replies: 17
    Last Post: 04-22-2011, 12:04 AM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 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