[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4182
  • Last Modified:

Hide part of a field- Social Security Number to show only last four digits-

I need to be able to convert a field that currently stores ssn- I need it to act like a password field where only the last four digits show and the rest are ***** on display.  I was unable to do it with an input mask. This is a two part question 1. HOw do I convert existing data and will this remedy work for future inputs?

The ssn field is a text and has no placemarkers.

Thanks,
Melissa Farmer

0
FatCat1973
Asked:
FatCat1973
  • 4
  • 4
  • 2
  • +2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I don't believe you will be able to pull this off in the table definition.

You can, however, create a query off of that table, where the last four are displayed as Last4: Right(SSN, 4)

Hope this helps.
-Jim
0
 
Steve BinkCommented:
If the input mask didn't work for you, you'll have to set up the mask yourself.  Jim's got the right idea for the data part.  For the display, create a label in front of your SSN text box like this:


| xxx-xx- |   0000  |
  label           field info
0
 
FatCat1973Author Commented:
Is there no way to edit the password input mask to work for this. I like that is stores the actual number but to view it is only an *

Melissa
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
AFAIK there is none, but feel free to play with it.

>I like that is stores the actual number but to view it is only an *
You can simulate that using "***-**-" & Right(SSN, 4)
0
 
dannywarehamCommented:
You can input mask the whole entry
If this is for viewing on a form, you can use a variation on Jim's method:

Dim myValue as String
myValue = Dlookup("yourfield", "yourtable", "RecID =" & chr(34) & Me.RecIDtextbox & chr(34))

myValue = Left(myValue,10) & "******"
Me.Textbox = myValue


Idea?
0
 
FatCat1973Author Commented:
Thanks so much- Sometimes my visions are better than what is able to be done- but that works for me in a query.

Thanks,
Melissa :)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Good luck with your hiding of sensitive informaiton.  Now you just have to worry about keeping the tables with SSN's secure.  

-Jim
0
 
FatCat1973Author Commented:
Danny I was trying to convert the data at the table level- I have to send out copies of our database to another government agency and we wanted to hide those first five digits in the table :(
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>hide those first five digits in the table :(
Why not just run an UPDATE query to remove the first five digits?  Tables are only intended to hold data, not to be a user interface, so if the end user of the table should not see the first five digits, just delete them.  Just my .02.
0
 
FatCat1973Author Commented:
That is excatly what I am going to do- thanks :)
0
 
dannywarehamCommented:
>>That is excatly what I am going to do
Hence teh accepted answer, Jim

:-p
0
 
fxzmamaCommented:
I had someone come to me with the same problem using Access 2007.  They are storing the full social security number in their table but only want someone else using an input form to see part of it for identification purposes or print out a report with only the last four showing.  Here is what I came up with (attached).
Access-2007-SSShow4Only-HowTo-LA.pdf
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now