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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems trimming data length. 1

Status
Not open for further replies.

Techdawgs

Programmer
Nov 12, 2004
14
US
I am working with a database where I am using the SSN as my primary key. The problem is sometimes I only want to display the last 4 digits. I thought normally I would use the right(stringexpr,n) function to accomplish this. With the code being written =right([SSN],4) but when I do I get an error. I noticed when I was typing it in the status bar at the bottom was indicating right(charcode).Any help would be appreciative.
 
I get an error
Any chance you could post the whole error message and the highlighted line when in debug mode ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The error that I get is "#error" and is displayed in my text box in my form. The code "=right([SSN],4)" is in the Control Source line of the text box properties.
 
In case some SSN are null you may try this:
=Right(Nz([SSN], ""), 4)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Alternative thought, is the control name SSN ?

If yes, try changing control name to (Say) txtSSN

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks everyone for their input. Ken your solution worked. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top