Password protect buttons

RichieP

Rock on!
Local time
Today, 13:15
Joined
Apr 16, 2003
Messages
48
How do I password protect certain button's on a form? I have a delete button and I only people who know the password to be able to delete records.
 
you could disable it until a user clicks a button and enters the right password. Or you could use user level security and only let certain users have the form that delete. So make two forms.
 
The easiest (but not very secure) way is to have a table with a single field and a single record eg tblButtonPwd

The on the click of the button

Sub cmdDelete On_Click
If Inputbox("Please type in the Password to enable the Delete") = Dlookup("[Password]","[tblButtonPwd]") then

run existing delete code

else
Msgbox "You have entered an incorrect password",vbExclamation,"Incorrect password!"
End Sub
This method actually shows what you are typing so prying eyes will be able to get the pwd though.

The more secure ways are (easiest to hardest)

-Use a form rather than an inputbox as you can set the textbox inputmask to password so all you will see is *******
-Have a login process for all users of the database and use this information to store delete rights via the user/staff table
-Create a workgroup and set rights for each user from there

hth
 

Users who are viewing this thread

Back
Top Bottom