Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


format a number to be xxxx

format a number to be xxxx

format a number to be xxxx

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
rich mcn
paradox user since 1994
version 8.0
8 users
windows xp and 2000

RE: format a number to be xxxx

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 #])

RE: format a number to be xxxx

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.

RE: format a number to be xxxx


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.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close