Results 1 to 8 of 8

Thread: Button Security

  1. #1
    gped
    Guest

    Button Security

    I have a button on a form that opens up another form within the same database. Would like to know how I can make this button secure with a password. Want to see when user clicks on this button a message box apperar requesting password id before allowing user to enter the associated form. If password is incorrect then a message box will appear saying so. Thanks in advance for your time and help

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Button Security

    If you're using Access security, you could simply assign permissions to the second form for particular users or groups, so no password would be needed. Alternatively, with security in place, you could check the user group the user was in and hide the button altogether if the user doesn't have permission to see it.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button Security

    I have security implemented on my database - how do you set the permissions for the particular button?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Button Security

    You don't. What you do is check the user in the open event of the form to see if he has permission to see the button. If he belongs in the group you want to allow access to the button, make it visible, otherwise don't.
    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button Security

    www.DataBaseCreations.com has security tools to take security to the control level.

    HTH John Graves

  6. #6
    davidd
    Guest

    Re: Button Security

    I have used this code many times.
    Private Sub close1_Click()
    On Error GoTo Err_close1_Click
    Dim stDocName As String
    Dim stLinkCriteria As String

    If InputBox("Enter Password for Directory Maintenance", "Confirm Delete") = "YOURPASSWORD" Then
    'stdocname is the form to open after the PW is entered
    stDocName = "frmDateTime"
    DoCmd.close
    DoCmd.OpenForm stDocName, , , stLinkCriteria


    End If



    Exit_close1_Click:
    Exit Sub

    Err_close1_Click:
    MsgBox Err.Description
    Resume Exit_close1_Click

    End Sub

  7. #7
    Star Lounger
    Join Date
    Jun 2002
    Location
    London, Gtr London, England
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button Security

    What about using the CUrrent User function like :

    If CurrentUser = "Joe Bloggs" then
    btnButton.enabled =false
    End if

    ?

  8. #8
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button Security

    This is OK

    What happens when users leave and new users start using the system? How many hardcoded objects have to be changed? Could be a maintenance nightmare.

    With the following code, its all done once in one place by the system administrator

    www.DataBaseCreations.com has security tools to take security to the control level.

    HTH John Graves

Posting Permissions

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