Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format a number to be xxxx 1

Status
Not open for further replies.

richmcn

Technical User
Sep 17, 2002
10
US
for security reasons
I would like to be able to enter a number on the form, say
a ssn number or credit card number but be able to xxxx out the leading or trailing number so that it can't be seen or printed
any ideas
thanks
rich mcn
paradox user since 1994
version 8.0
8 users
windows xp and 2000
 
Use a calculated field, set the field to "xxxx" + substr([Field], startIndex, endIndex). This will work on both forms and reports.

For a credit card something like this:
"####-####-####-"+substr([CARD #],size([CARD #])-3,size([CARD #])
 
Dear Kliot
Thanks for your prompt help in helping me break new ground.
I am still developing, but for sure
"XXXX-XXXX"+subStr(Card_#, 10, 5)
works like a champ.
I'll play a bit more with size.
Regards!
Rich
 
Rich,

You're very welcome. The advantage of using size is you are not dependent on the fixed length of the string. With the credit card example you will always see the last four digits of the card. Credit card numbers used to be 12, 15 or 16 digits long. With your example if a card number less than 16 chars was entered an error would result.

Perrin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top