Toggle Password

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:42
Joined
Jul 9, 2003
Messages
17,445
George Hepworth demonstrates how to toggle a password to plain text:-



 
No sound? :(
I use the same method for web pages.
 
I saw the logic from the code window.
That is why I said I do the same for Web pages. Often I cannot remember what the password is, :( even though the browser has saved it. I use the same method to check.
I dare say the web developer does it the same way?
 
Once you start thinking about it, it's sort of obvious. Unfortunately, it was a response to a post on another Access forum which questioned that it would work. :rolleyes: I sort of felt compelled to spread the word. ;)
 
Once you start thinking about it, it's sort of obvious. Unfortunately, it was a response to a post on another Access forum which questioned that it would work. :rolleyes: I sort of felt compelled to spread the word. ;)
Actually, I think it could be made more elaborate and complicated by requiring the kind of second validation that my browser imposes. "Enter your PIN to see the plain text." sort of thing.
 
Then if you forget your pin, you have to have a Recover Pin option. :-)
 
Then if you forget your pin, you have to have a Recover Pin option. :)
I just got a reply that this code clears the textbox, not just changes the input mask, in an Access 2016 accdb.

I don't A2016 available. Can someone please check it out on A 2016?

Private Sub imgOpen_Click() If Me.txtPWD.InputMask = "Password" Then Me.txtPWD.InputMask = "" Else Me.txtPWD.InputMask = "Password" End If End Sub
 
I just got a reply that this code clears the textbox, not just changes the input mask, in an Access 2016 accdb.

I don't A2016 available. Can someone please check it out on A 2016?

Private Sub imgOpen_Click() If Me.txtPWD.InputMask = "Password" Then Me.txtPWD.InputMask = "" Else Me.txtPWD.InputMask = "Password" End If End Sub
I would ask to see the actual code?
My first thoughts that they have
Me.txtPWD ="" ?
 
I would ask to see the actual code?
My first thoughts that they have
Me.txtPWD ="" ?
The OP claims to have copied my code. But, then, I didn't think to ask for a double-check.
 
I can't get the old V
Sorry. I don’t have a VM with A2016 ATM
I can't get my older VM to connect. The one that does has A2010 on it. It actually DOES process as expected, though.
 
Well, here we go:

"It might be imgOpen causes the problem. The form does not like image? I switched to a command button, it is fine. I am doing further testing and let you know."
 
The OP claims to have copied my code. But, then, I didn't think to ask for a double-check.
Having seen members on here and elsewhere, I would always ask.
I also hate those that post something and you mention that the their code is faulty and they say that is not the actual code, just an example. They generally go on my IL quite quickly.
 
I figured out the problem here. Long story short.

When the code is on the click event of an image control, the user types characters into a textbox control, and the user directly clicks on the image control, the BeforeUpdate and AfterUpdate events of that textbox control do not fire. That means, I think, that the characters are lost and it looks like the control has been cleared. The code on the image control's click event does fire, but because the text was lost, it seems to have no impact.

When the code is on the click event of a command button control, the user types characters into a textbox control, and then directly clicks on the command button, the BeforeUpdate and AfterUpdate events of that textbox control do fire.

When the code is on the click event of an image control, the user types characters into a textbox control, and then clicks on any other control before clicking the image control, the BeforeUpdate and AfterUpdate events of that textbox control do fire. That means, I think, that the characters are not lost.

I have no idea why the image control seems to bypass the BeforeUpdate and AfterUpdate events of the textbox control, but it sure looks like it to me.

I don't know how this would work on a continuous form.
 
George, would it be possible to set the .value to the .text property, if for some strange reason someone insisted on wanting to use an image control?
 
George, would it be possible to set the .value to the .text property, if for some strange reason someone insisted on wanting to use an image control?
That's an interesting idea, too.

I settled on this solution, which seems to me to be really simple. But there are almost always ways to enhance even the most basic code.

Code:
Private Sub imgimageOpen_Click()


    Me.cboEmployee.SetFocus
    If Me.txtPWD.InputMask = "Password" Then
        Me.txtPWD.InputMask = ""
    Else
        Me.txtPWD.InputMask = "Password"
    End If
    Me.txtPWD.SetFocus
 
End Sub
 

Users who are viewing this thread

Back
Top Bottom