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!

=Trim error! message

Status
Not open for further replies.

BH

Programmer
Oct 15, 2002
76
GB
Can anyone tell me how to trim text box data in a report?

What I have got is a number of reports that have names and addresses as you would have when writing a letter i.e

Mr Joseph Bloggs
9 Blogg Street
Blogg City

What I require is if the 'Joseph' is just a 'J' then the text box reduces in size so there is not a big gap between the first name and surname i.e.

Mr J Bloggs
9 Blogg Street
Blogg City


If you do this on labels using the trim function i.e

=Trim([First Name]&[Surname])

it seems to work fine but I can not get it to work on a report! It just throws up an error! on the report.

Horizontally I know you can use the properties 'Can Grow' and 'Can Shrink' is there anything for vertical text?

Can anyone help please?

BH
 
The accepted way to do this is to create a query using your table to be used as the RecordSource for the Report. In your query you create a new field called Name where you perform the Trim and cancatenation process to push it all together and make it look good:

Name: "Mr. " & Trim([FirstName]) & " " & Trim([LastName])
Now you create control on your report with the Control Source being Name from the field list. The name will look just fine whether it is J or Joseph.

If you have any question please get back with me. Bob Scriver
 
scriverb

That has worked spot on, the reports now look a lot more professional.

Thank you very much for sharing your expertise

BH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top