+ Reply to Thread
Results 1 to 9 of 9

Textbox masking confidential item input with hide & show button?

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Textbox masking confidential item input with hide & show button?

    Good Afternoon Everyone-

    Until a few days ago the last time i worked in Access (if i recall) was somewhere around 2011 or so, and since i have an issue remembering what happened even a few minutes ago, i'm close to starting at the beginning. Fortunately with the extreme help from people in the Excel forums here i have worked in that for a number of years, so i am not completely clueless... (just nearly clueless).

    I am putting together an Access project for a friend. We need to record customer Social Security Numbers (SSN) and Date of Birth (DoB).

    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!

    -Bruce

  2. #2
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Textbox masking confidential item input with hide & show button?

    The TextBox has an InputMask property https://learn.microsoft.com/en-us/of...tbox.inputmask

    "Setting the InputMask property to the word "Password" creates a password-entry control. Any character typed in the control is stored as the character but is displayed as an asterisk (*). You use the Password input mask to prevent displaying the typed characters on the screen"

    Will that work for you, or do you need a more bespoke control for SSN and DOB?

  3. #3
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: Textbox masking confidential item input with hide & show button?

    Thank you for replying!

    What i am looking for is a mask for the textbox like the ones for SSN and Date that will provide basic input formatting and restriction AND the obscuration of the password input mask AND the ability to turn the password mask on or off with a user command button or the like. Kind of wondering if the same HTML/Javascript or howevertheydoit code used on webpages can be somehow used in Access...

  4. #4
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Textbox masking confidential item input with hide & show button?

    Okay, you could probably use VBA via the on keydown or keypress event of the textbox,
    the textbox does have a Social Security mask but that just sets it to 000-00-0000 without the ability to hide the numbers (that I could see)

    Perhaps combined with that and a bit of code to change the numbers to * (while keeping the actual value) and a toggle button.

    I'll play around with it some, if you'd like. In between my grandkids visiting :-)
    Attached Images Attached Images

  5. #5
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Textbox masking confidential item input with hide & show button?

    I created some code to handle masking the SSN, you should be able to adapt it for the DOB.
    My form has a textbox called txtSSN and a button to toggle viewing masked or not.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: Textbox masking confidential item input with hide & show button?

    I'm finally at the point of being about to implement this.

    I had switched focus from worrying over the details to building the structure, and this project took a heck of a lot of hours more than i thought it would eat up - as i've got a family and for some reason wasn't born rich, am not bright enough to become rich and have not yet won the Publisher's Clearing House lottery (...), i've had to squeeze it in when i can...

    I am looking forward to working with the code you graciously provided and reporting back.

    Thank you!

    -Bruce

  7. #7
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Textbox masking confidential item input with hide & show button?

    Quote Originally Posted by brucemc777 View Post
    I'm finally at the point of being about to implement this.

    I had switched focus from worrying over the details to building the structure, and this project took a heck of a lot of hours more than i thought it would eat up - as i've got a family and for some reason wasn't born rich, am not bright enough to become rich and have not yet won the Publisher's Clearing House lottery (...), i've had to squeeze it in when i can...

    I am looking forward to working with the code you graciously provided and reporting back.

    Thank you!

    -Bruce
    hahaha wasn't born rich, I heard that! I hope this helps and works out the way you need it to.

  8. #8
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: Textbox masking confidential item input with hide & show button?

    Frankly, i am thrilled with it. Not only does it do everything i wanted, but i am learning from how you code. The sequential blocks make my coding look, well, like spaghetti. Thank you VERY much!

  9. #9
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Textbox masking confidential item input with hide & show button?

    You are very welcome, happy to lend a hand!

    Good luck with the rest of your project.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using an Option Button and another button to hide/show lines
    By dharvey1978 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2021, 06:13 PM
  2. Replies: 4
    Last Post: 12-11-2018, 01:11 PM
  3. [SOLVED] Hide or disable option button or show empty graph when slicer item has no data on userform
    By Raylou in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2018, 05:24 AM
  4. Replies: 6
    Last Post: 08-31-2017, 12:16 PM
  5. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  6. Masking an input box?
    By british.assassi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2005, 02:25 PM
  7. Masking on TextBox
    By Santiago in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1