Results 1 to 7 of 7
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754

    CheckBox to unmaks a password input mask

    Hi all,
    I had the code for this once but i cannot find it anywhere, even on web.... Does someone have the code to
    remove the input mask on a form txtbox that has the password mask on it? I want to use a check box on


    the password txtbox on my form to show password and hide it by ticking a chkbox.
    Thanks
    Dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,857
    Isn't just changing the inputmask?

    https://docs.microsoft.com/en-us/off...tbox.inputmask

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    On the VERY RARE occasions I do this, I use a hidden text box with no input mask overlaying the visible text box with a mask.
    Next to both I have a Show Password button that when clicked & held down flips the visibility of the two textboxes so the password is exposed.
    When the button is released, the textbox visibility reverses again so the masked version is visible once more.

    However as a word of caution, you should NEVER rely on a password input mask to protect passwords as its far too easy to remove the mask.
    I recommend ENCRYPTING passwords using RC4 encryption or similar. Or better still do NOT store passwords in the app.
    Instead use Active Directory to handle passwords safely
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    you can use the mouse down\up events on an image Click image for larger version. 

Name:	download.png 
Views:	13 
Size:	4.8 KB 
ID:	43342
    with code

    Code:
    Private Sub Image4_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Text0.InputMask = ""
    End Sub
    
    
    Private Sub Image4_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Text0.InputMask = "Password"
    End Sub
    The password will show only when you hold down the mouse button over the image.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    True but why use an image?
    You can do that mouse down/up code using a command button or directly on the textbox itself
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Quote Originally Posted by isladogs View Post
    True but why use an image?
    You can do that mouse down/up code using a command button or directly on the textbox itself
    image not required just emulates what you see on a lot of sites
    Click image for larger version. 

Name:	nEFlh.png 
Views:	11 
Size:	9.7 KB 
ID:	43343
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Ah I see.
    Anyway, that code indeed works perfectly where a password has just been masked.

    I should have said that the reason why I use two textboxes is because I use encryption. The normally hidden textbox contains the decrypted version of the password
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 04-14-2018, 03:35 PM
  2. Replies: 4
    Last Post: 03-28-2017, 03:10 PM
  3. Replies: 2
    Last Post: 02-27-2015, 10:03 PM
  4. *** mask password in inputbox
    By Kvracing in forum Modules
    Replies: 13
    Last Post: 11-21-2014, 07:22 AM
  5. Web Database: Input Mask for Password
    By besuchanko in forum Forms
    Replies: 3
    Last Post: 07-25-2013, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums