Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to put password on a button

Status
Not open for further replies.

Phideaux

Technical User
May 1, 2003
51
US
I need to put a password on a bush button. in fact i need to put different passwords on 3 buttons on the same form. I've read up on puting a password on a form and done that to slove some one of the barriers i'm encountering, but i'm doing something wrong when it comes to putting a password on an individual button. I want the password to be required to perform the buttons function. if the wrong P/W is supplied to do nothing but display the "Wrong Password" message. what's the best way to do this?

thanks in advance for all of the help so many of you have provided.

Phideaux

The mind is the best toy.
Play with someone else's often
 
Don't build your own security like this. If you do, you're on your own. Use the security built in to access. It's more secure than anything you can build (though still not bulletproof), and there's tons of dox for it (like the faq, which you can get from me or the MS site).

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Professional Development for Clients Large and Small

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
This isn't intended for a "security measure" it's to deal with accidental and other "mistaken triggering of the button" It's to force several "Meat Headded Users" users to slow down and think as they perform the operations linked to the button.

Thanks for your input and insight.

phideaux

The mind is the best toy.
Play with someone else's often
 
One approach would be to place the correct password in the .Tag property of the Button.

Then in the button click event, ask for a password, compare and process accordingly.

Sub cmdButton_Click()

GetPW = InputBox ("Please Enter PW for this function")
If GetPW = cmdButton.Tag Then
ExecuteButtonCode
Else
MsgBox "Incorrect PW for this function"
End If

End Sub

Sub ExecuteButtonCode
...



Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top