Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > Forums > Developers
Back to Access Developer Forum    Comments List
Textbox masking confidential i Upload Images   Link   Email  
Bruce McCormick      
30 days ago
Good Afternoon Everyone!

Ohhhhh i feel so guilty in doing this as this is what is called a "cross post", but as this is a private forum and the duplicate post is in, a public forum, i hope the internet won't take offense.

I need to record customer Social Security Numbers and Date of Birth and am concerned with "over the shoulder" attacks-

Best case would be a means similar to webpages where it could be entered with momentary visibility by character, then obscured, along with a Show/Hide button.

Basically, to simultaneously use both the SSN and Date input masks, or replicate them in VBA.

Seems to me there certainly is a solution out there, but i have become rather frustrated trying to find it - Would any of you good folks be able to point me in the right direction?

Thank you for considering my problem and for your expertise and kindness!

Adam Schwanz              
30 days ago
You should just be able to use the password input mask, and then a button that removes the input mask and reapplies it.

    If MyField.InputMask = "Password" Then
        MyField.InputMask = ""
        MyField.InputMask = "Password"
    End If
Thomas Gonder       
30 days ago
I see the "code" being tagged as such in Adam's post, but I don't see how to do that.
Richard Rost             
27 days ago
Thomas: it's a special moderator feature. Sorry. :(
Thomas Gonder       
26 days ago
Hi Bruce, I tried Adam's idea using this kind of code and Access seems to do weird stuff like ignore the entry when running this code:

Private Sub SSN_KeyUp(KeyCode As Integer, Shift As Integer)
  SSN.InputMask = ""
  Sleep 500
  SSN.InputMask = "Password"

So, in my version, I don't think it's possible to do what you asked key-stroke at a time.
Bruce McCormick      
25 days ago
I greatly appreciate all of your kind responses! I'm afraid over the weekend i've spent two 8 to 9 .5 hour days fighting with my daughter's 2009 KIA doing two jobs that i've previously done on other cars in three or four hours total...

I see information above that handles two of my three issues, but the real crux (aka "bugger") of the situation is to have those items AND add in the SSN mask - is there a means?
Adam Schwanz              
25 days ago
I think this solves all your problems? Maybe I misunderstand what your trying to do, can you elaborate?

If you have by default the input mask set to password on your SSN and date field, they will type out like ******. Using the button with my code would display the value temporarily by turning off the mask, what was needed additionally?

I see you want to see the last letter typed, you couldn't put the input mask on just certain parts of the field. You'd have to make a custom function that would take what you typed, save it in a variable, replace the string with ***s, type the next letter, add it to the variable, replace your string with ***s again until you finished, then save the value of the variable to the field, and put an input mask ontop of it. It's doable but seems really clunky. You could just make a second unbound textbox, and send the letter you press to it so you can see. I'll attach an image.
Adam Schwanz              
25 days ago

Kevin Yip       
25 days ago
One way to hide/unhide text without using input masks is use a password font, one that shows every character as a dot.  Hiding or unhiding the text would only require changing the font.  Use a button as a toggle for hiding or unhiding.  To mimic how most websites do it, set the button's MouseDown event to change the textbox's font to a regular font (thus revealing the text), and its MouseUp event to change back to the password font and hide the text.  The password font needs to be installed on every PC that uses this feature, 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       
25 days ago

Christopher Hankwembo    
22 days ago
But access has already that property at table design level, we always use it, no need for code:

Christopher Hankwembo    
22 days ago

Kevin Yip       
22 days ago
Input masks don't work for this due to one obscure but crucial aspect.  You can try this:  Type something in the text box with the password mask.  Before you save it, change the input mask with the above VBA code to reveal the password (as most users would want to see what they typed before saving it).  You'll see that what you just typed is replaced with what was in the textbox before.  If the textbox was blank, what you just typed would be replaced with a blank.  

I avoid input masks in general because of this and other reasons.  In other programming environments, I also find input masks to be more nuisance than help because it could be visually confusing to the users if what they type isn't exactly what they see on the screen.

The technical reason for the above behavior is that while you are typing in the textbox, what you see is not the textbox's value (SSN.Value), but the value of its .Text property (SSN.Text).  An input mask only works on the textbox's true value, not its .Text value, and that's why it doesn't work.
Thomas Gonder       
22 days ago
@ Kevin In the third sentence, when you say "Before you save it...", do you mean save the record or move focus to a new control?
What code would show the .Value and how would you invoke it before moving to a new control like a button?
Bruce McCormick      
22 days ago
Thank you so very much, everyone!

What really amazes me is that there is apparently no pre "canned" function/method/sub to do this. I know we are not talking military encryption with Access, but i would think that they would accommodate protection from the "over the shoulder" phishing attempts, or just plain basic courtesy from a screen sitting in the open displaying what should be considered personally identifiable information. Heck, i've lived my life so far without giving much of a darn - my SSN was also my college Student ID and was my pilot's license number long ago (thanks for reminding me, 50 years ago almost to the month) when i got that, but with how freakish society has become (which i think has been a matter of hype and selling "identity protection" plans and other garbage like both Norton and McAffee are now mostly), i really thought that items like SSN, DOB, maybe even phone number fields would inherently provide for both input masking and character masking that can be toggled for verification. Ahhhhh, what a world.

Putting away my soapbox, i want to emphasize how much i appreciate you folks coming to my assistance. The world needs more of you.
Kevin Yip       
22 days ago
Hi Thomas, as soon as you change the textbox's content and movie focus away (without necessarily saving the record, i.e. while the form is still dirty), the phenomenon described in my previous post will occur.

The Value property is the default property, so if you omit it (e.g. Me.MyControl), it's assumed you use the Value property (Me.MyControl.Value), which is the "saved" value of the control.
Thomas Gonder       
21 days ago
@ all This was an interesting thread, and I learned a few things. Based on it I changed my User Form to use what I think, IMHO, might be the best solution presented. I'm guessing this solution is in many web pages because their authoring environment has the same issues as our old Access with password masking. Only two functional lines of code are needed and a little Paint editing for a button icon.

In the image below, a left mouse down will "unmask" the Password, and releasing the mouse covers it back up. I like it as it should prevent the normal "over the shoulder attack", unless a VERY high-definition CCTV is monitoring input. (You know, one that is better than my home security system that pixilates a license plate at 10 meters.)
Thomas Gonder       
21 days ago

Add a Reply Upload an Image


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

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

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/19/2024 8:41:25 AM. PLT: 0s