View Full Version : Limit number of characters in a report textbox
dfuas 01-08-2006, 06:25 AM Hi everybody,
Is there a way to limit the number of characters displayed in a report.
Say I have a word like "Internet" on a table but on my report I want only to see the first 5 characters to be shown, in this case would be "Inter".
Is there a way to achieve this?
Thanks
dfuas
Make the textbox smaller and set the can grow to no
llkhoutx 01-08-2006, 12:22 PM If you know the number of character, use the Left function to peel off the requisite number of characters in the controls record source property.
Bigmo2u 01-09-2006, 10:49 AM I have the same question. I am trying to do it with an SSN = 9 digits and I only want the last 4 digits on the report, but i don't know how to build it in expression builder.
llkhoutx 01-09-2006, 09:08 PM Use Right(me!SSN,4).
Bigmo2u 01-10-2006, 09:23 AM Use Right(me!SSN,4).
I put that in the record source of SSN exactly how you wrote it. Is that 'me!' the report name or the query name or is it just suppose to be how you wrote it?
I did it as you wrote it and as SSN = Right(me!SSN,4) neither seems to work.
Sorry I am new at this.
your help is greatly appreciated.
llkhoutx 01-10-2006, 09:47 AM The control recordsource should be "= Right([SSN],4)" without the quotation marks, to display the right four digits of the social security number field. The brackets are not required, but indicates that SSN is a field in the recordsource.
Bigmo2u 01-10-2006, 10:39 AM I have attached what I am doing and maybe you can tell what is wrong and why it's not working.
I know it is the best image but if you squint you can see it.
thanks
Craig
llkhoutx 01-10-2006, 12:15 PM The formula is right. Therefore, SSN is not in the report's recordsource. Substitute the field in your report's recordsource which represents the social security number for SSN. Isn't that obvious?
Bigmo2u 01-10-2006, 12:30 PM It is obvious and the SSN is in the record source.
I have attached it to show you.
llkhoutx 01-10-2006, 12:37 PM I see SSN in the recordsource. However, the formula is right.
What are you getting in that field in the report's preview mode?
change the name of the textbox to something other than SSN
llkhoutx 01-10-2006, 12:48 PM Rich, I think that you're right.
Bigmo2u 01-11-2006, 08:50 AM The error on the report is #Error.
What do you mean change the name on the text box to something other than SSN?
llkhoutx 01-11-2006, 10:25 AM Haven't you tried Rich's suggestion?
change the name of the textbox to something other than SSN
Bigmo2u 01-11-2006, 11:11 AM Haven't you tried Rich's suggestion?
Please look at what I attached and see if that what you mean by changing the textbox to something other than SSN? If that is what you mean I tried that and get the same error message on the report. If I use the say box and use the code =Right([City],4) it works for the city in that box. I will play with it I think I understand it now.
Bigmo2u 01-11-2006, 11:23 AM Okay I figure it out guys I have attached where I changed the name in the Textbox. it was in the other TAB and I changed the name to Last 4 and now it works...
Thanks for your patients with me. You guys are awesome. :) :)
|