Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Password Reveal with Eye Image
Jennifer Neighbors 
     
2 years ago
I am having trouble creating code to reveal a password temporarily. I have a small eye image that I want to display the password while the user presses it and hides it when released.

If the user has typed their password but hasn't yet tabbed out of the field (and this is when the reveal might be helpful), my code merely erases the password. I've tried variations of the following. This works perfectly after the user logs on by tabbing out of the password field, but it's a little useless then because, by that time, a wrong password would have them kicked out of the database.

Private Sub imgEye_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
      txtPWD.SetFocus
      txtPWD.InputMask = ""    
End Sub

Private Sub imgEye_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
      txtPWD.SetFocus
      txtPWD.InputMask = "Password"  
End Sub
Kevin Robertson  @Reply  
          
2 years ago
I would use the OnClick event and an If Then statement.

Reveal Password w Input Mask
Jennifer Neighbors OP  @Reply  
     
2 years ago
Thanks for the input and fast response, Kevin!

When I tried your solution, the database logged me on using the string I entered as the password. If the password were wrong, I would be booted out. I am looking for a solution that allows the user to see what they have entered without triggering the logon so they can correct the password if needed. After logging on using the correct password, the checkbox revealed the password. In this scenario, however, I must click the checkbox again to hide it. Ideally, I would prefer the key down and key up approach so the reveal is quick and temporary.

Thanks again; I appreciate it!
Kevin Yip  @Reply  
     
2 years ago
One way to do this without using input masks is use a password font, one that shows every character as a dot.  Put an image control with the eye-closed image on the form and set its MouseDown event to change the textbox's font to a regular font (and change the image to the open-eye image), and its MouseUp event to change back to the password font and the eye-closed image.  The password font needs to be installed on every PC that uses it, and that may be a hassle.  Password fonts like this can be found for free on the Internet.  The picture below shows how it may look.
Kevin Yip  @Reply  
     
2 years ago

Jennifer Neighbors OP  @Reply  
     
2 years ago
Kevin Yip, it worked well during my initial testing. I think you've come up with the solution! Fantastic!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 10:17:52 PM. PLT: 1s