Password protect a delete button

  • Thread starter Thread starter Bill Davis
  • Start date Start date
B

Bill Davis

I have a delete button on a form and I would like to have
it password protected so that only authorized personal
can delete record. How can I code this so action..
Thanks in advance
 
Th simplest way is to use the InputBox function. When the
user clicks the button, your code should look like this:

If InputBox("Enter password") = "somepassword" Then
'run some code
Else
MsgBox "Invalid Password"
EndIf

*You cannot hide the password in an input box with
asterisks.

You could also do this with a custom pop up form. Use a
textbox for the password and you can reference the value.
You can also use the password format to hide the password
as the user types it in.

NOTE: All of these depend on your uses not being able or
not knowing how to get to your code.

Hope this helps,
Crystal
 
Back
Top