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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password protecting an action button

Status
Not open for further replies.

lisss001

Technical User
Nov 21, 2005
12
0
0
GB
Hello, I have created a form which I would like password protected. Basically all I have is a few action buttons and a text field. I only want the action bittons to perform a function if the text field has the correct password entered into it. Is this possible ?

Here is my current form:
Any help on this matter would be appreciated ;)
 
What had you in mind? Full Access security or simply looking up the password entered in a table and preventing any further action if it is not found?
 
Basically preventing further action until it is entered. I don't want full access security, just some sort of security to prevent the buttons on this form from running correctly until a password has been entered.
 
The best bet might be to hardcode your password and either create an mde or protect your code by an additional password. Then it is just a matter of a little code:

[tt]If Me.Password = day(date) & month(date) & "ABC" Then
Me.cmdClickMe.Enabled = True
Else
Me.cmdClickMe.Enabled = False
End If[/tt]

Or such like. This is by no means secure, but it will prevent casual tampering. The addition of day and month to the password makes the person entering it think for a second or two, which can be a good thing.


 
thanks for your help, just one question though, What would I need for this code to work a text box or what ? also what would the resulting password look like ?

Anyway thanks for the help.
 
I am a little lost. In the link you posted, there is a textbox and a command button. It seemed to me that you wished the command button to work if the password entered in the textbox matched some criterion. If you design the form with the command button disabled, you can use the verify button to enable it, if the password is correct (sample code above). If you set the input mask of the textbox to Password, the password will appear as a row of asterisks, as shown in your link. In the example I posted, the password for today would be 2711ABC and tomorrow it would be 2811ABC, but this is only an example, pick whatever seems most suitable for a password.
 
Hi, that is what I wanted, however I am just wondering what I have to name the button etc for it all to work. Thanks
 
The name you have already is fine. Why not try some code and if you get stuck, post the bit(s) that don't work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top