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

Password on a button?

Status
Not open for further replies.

Valheru

MIS
Jun 3, 2002
5
US
Hello all,
I would like to create a "Delete" button, and have it open a textbox asking for a password. Can this be done? I have three buttons on a form: Delete, Update, and Exit. Could I have a tblPassword table that could be matched?
Thank you
 
Hi :)

Will you think of trying Input Methid like

Private Sub CmdDelete_OnClick
Dim strInput as String

StrInput=InputBox("Enter Password to Delete")

If strInput="Your Secret Word" Then
'Prodedure for Delete Record
Else
Msgbox("Not Authorised to Delete")
End If

End Sub

You can also declare another variable as StrPW and then can match the passowrd by using DLookup method.

Hope this help :)

Cheers!
Aqif
 
You could use the InputMethod....but I can think of one main reason not to.....the InputMethod does not support the Password Mask...i.e. if you password is okay, when you type okay, okay is displayed instead of ****.....this puts your password in the clear.

My recommendation....create your password table and in the field that contains the passwords, put Password in the porperty for InputMask. This will mask your passwords to anyone that might access the table somehow.
Next, create a small form, with PopUp and Module properties set to yes. This form should contains just the one field for the password to be entered. Your delete button should open this form with the acDialog option. Using the AfterUpdate property of this field, check to ensure the password is correct and perform you procedures as necessary.

I have an example of this set up if you would like to see it. Send me an e-mail at the address listed in my profile and I will send the database. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top