Changing password code (1 Viewer)

davey3389

Registered User.
Local time
Today, 22:38
Joined
Jul 16, 2012
Messages
30
I have this code on the form:

Private Sub Command31_Click()
Dim strPassword As String
strPassword = "Test"
If InputBox("Please enter the password") = strPassword Then
DoCmd.OpenForm "frmClient"
Else
MsgBox "Incorrect Password used"
End If
End Sub

Is there anything i can change/add to hide the password as its typed in and also to change the look of the input box

Thanks,

Ben
 

Trevor G

Registered User.
Local time
Today, 22:38
Joined
Oct 1, 2009
Messages
2,341
Ben if you want to do this like encryption then you need to create a form with a textbox on it, in the textbox properties you then can name it and also set the format of the property to Password.

The code I gave you can then be adapted to check the contents of the textbox rather than the inputbox and open the form if the contents match or use the message box if it fails.
 

davey3389

Registered User.
Local time
Today, 22:38
Joined
Jul 16, 2012
Messages
30
Ok would you be able to send me a copy of the code i need

Thanks
 

Trevor G

Registered User.
Local time
Today, 22:38
Joined
Oct 1, 2009
Messages
2,341
See example

Open the frmPassword form the information is there. So Open the form to start with and type in test that will allow you to see the other form. Miss Type and it will give you a message.

The properties of the textbox set the InputMask to PASSWORD.
 

Attachments

  • SetTotal.mdb
    248 KB · Views: 61

Users who are viewing this thread

Top Bottom