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

Hide password text

Status
Not open for further replies.

terre

Technical User
Feb 2, 2003
97
AU
I have found this code to input a password........
but the text shows as letters and not as the usual stars...****

How do I hide the password using the inputbux cmd?

Private Sub Command110_Click()
On Error GoTo Err_Command110_Click
DoCmd.OpenForm "Initialise"
DoCmd.GoToRecord acDataForm, "initialise", acFirst
Dim Tries As Integer
Tries = 0
Dim Password, Pword
Password = Forms!Initialise!Text2
DoCmd.Close
GoTo Pwd

Pwd:
Pword = InputBox("Type in your password")
Tries = Tries + 1
GoTo Check

Check:
If Tries >= 3 Then MsgBox "Sorry, 3 Tries and I Quit": DoCmd.Quit
If Pword <> Password Then
MsgBox &quot;Sorry, incorrect password&quot;
GoTo Pwd
End

End If
Form!SchoolDocs.Visible = True
Command111.Visible = True
Exit Sub


Exit_Command110_Click:
Exit Sub

Err_Command110_Click:
MsgBox Err.Description
Resume Exit_Command110_Click
 
[tt]
Hi Terre:

The following paragraph is from Access 2002 Help, but I think it is backward compatible:

&quot;Setting the InputMask property to the word Password creates a password entry text box. Any character typed in the text box is stored as the character but is displayed as an asterisk (*).&quot;

The InputMask property can be set on the property sheet of the control (Format), or in Visual Basic for Applications. [glasses][tt] Gus Brunston - Access2000(DAO)[/tt] Intermediate skills.
 
how do I set the InputMask property for InputBox?
 
[tt]

As always, before making significant changes, back up your work. Then,

1) With your form in Design View, right click on the control that is bound to your password field.

2) You will see a pop up menu. The last item in the menu is &quot;Properties&quot;. Click on &quot;Properties&quot;.

3) You will see the Property sheet for your control, with 5 tabs across the top. Click on Data.

4) In the row 'Input Mask', enter &quot;Password&quot;.

5) Close the Property sheet.

6) Save the form.

When you get this working, go back and see all the other things you can do in the property sheet.

You can also set the Input Mask property for a field in a table in design view. Use the Input Mask Wizard. [glasses][tt] Gus Brunston - Access2000(DAO)[/tt] Intermediate skills.
 
Thanx for your time here...

But...

When using InputBox....the password is not bound to any control..........(is it)?
 
[tt]
Gee...

And all this time I thought we were talking about a text box. Just goes to show ya... [glasses][tt] Gus Brunston - Access2000(DAO)[/tt] Intermediate skills.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top