Hiding typed text

  • Thread starter Thread starter Greg Ripper
  • Start date Start date
G

Greg Ripper

I use this OnClick event to force someone to type in a password to access
a form. I know it is easily bypassed, but is there a way to his the text
being typed?

Rip

Dim sPassword As String, sAccess As String
sAccess = "admin"
sPassword = InputBox("PLEASE ENTER THE PASSWORD", "PASSWORD")
If sPassword <> sAccess Then
Cancel = True
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdmin"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Rip
 
I use this OnClick event to force someone to type in a password to access
a form. I know it is easily bypassed, but is there a way to his the text
being typed?

Rip

Dim sPassword As String, sAccess As String
sAccess = "admin"
sPassword = InputBox("PLEASE ENTER THE PASSWORD", "PASSWORD")
If sPassword <> sAccess Then
Cancel = True
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdmin"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Rip

Rip,
Not using the InputBox().

Create your own unbound form.
Add an unbound text control.
Name the control "EnterPass"
Set it's InputMask property to "Password".
Add a command button to the form.
Set it's Click event to:
Me.Visible = False
Name the form "frmPassword"

Then modify your code so that it looks like this:

Dim sPassword As String, sAccess As String
sAccess = "admin"
DoCmd.OpenForm "frmPassword", , , , , acDialog
sPassword = forms!frmPassword!EnterPass
DoCmd.Close acForm, "frmPassword"
If sPassword <> sAccess Then
Cancel = True
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdmin"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
 
Back
Top