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

A Password InputBox with asterisks

Status
Not open for further replies.

zevw

MIS
Jul 3, 2001
697
US
I am prompting the user to enter a password when going into a certain form. How can a have an inputbox, and when the password is typed in, they should only see asterisks on the screen. The same as it would be when I have an inputmask set with the password property.
 
hi,

i don't think this is possible but you can easily create this yourself:

declare a public variable in the form you want to protect
Public bln_pwdok as boolean

then in the form_open procedure add:

DoCmd.OpenForm "form1", , , , , acDialog

Do While SysCmd(acSysCmdGetObjectState, acForm, &quot;form1&quot;) <> 0
DoEvents
Loop

If Not bln_pwdok Then
MsgBox &quot;no access to this form&quot;
DoCmd.CancelEvent
Exit Sub
End If

then you create a new form (in my case &quot;form1&quot;) with a textbox on it

Private Sub text1_afterupdate()

If Me!Text1 = &quot;mypwd&quot; Then
forms!myprotectedform.bln_pwdok = True
End If

DoCmd.Close acForm, &quot;form1&quot;

End Sub

watch out:
1. the &quot;control box&quot; property for form1 you want to disable
2. in the inputmask for text1 you choose password

this should do the trick.

CPU-burn


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top