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!

Formatting a password text box to use the *

Status
Not open for further replies.

Alanclyde

Technical User
Jun 5, 2009
22
0
0
GB
I have some code (not written by me I hasten to add)for issueing and accepting a password from a MS Access TAB CONTROL ...When I input the password it still appears as full text, how can I fromat that part of the code so I am typing in * as is normal practice for PASSWORD entries.
****************************************************
' If tab page with Tab Index of 1 is selected
' show InputBox asking for password
If TabCtl0.Value = 8 Then
strInput = InputBox("Please enter a password to access this tab" & vbNewLine & vbNewLine & "", _
"Restricted Access")

' Check if value is entered into InputBox
' If no value entered display MsgBox
If strInput = "" Or strInput = Empty Then
MsgBox "No Input Provided", , "Required Data"
TabCtl0.Pages.Item(0).SetFocus
Exit Sub
End If

' Check InputBox value and if value is a match
' display tab and unhide hidden fields
If strInput = "password" Then

For Each ctl In Controls
If ctl.Tag = "*" Then
ctl.Visible = True
End If
Next ctl
' If incorrect password supplied return to tab (index 0)
Else
MsgBox ("Sorry, you do not have access to this information")
TabCtl0.Pages.Item(0).SetFocus

Exit Sub
End If
End If

End Sub
***************************************************
 
Use a TextBox instead with the Format property set to "password".

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top