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!

Printing Access 2000 report without trailing spaces from data fields

Status
Not open for further replies.

cotton

Programmer
Mar 7, 2001
11
US
I have an employee list table with Name, address, phone #,
and etc. I want to print these fields taking out the trailing spaces so I can line them across my page. I have tried RTrim. I want it to look like this: Thanks for all suggestions.

John Doe Jane Doe
126 First ST. 444 High St.
Ocean Srpings MS. 39564 Ocean Springs, Ms. 39564
228-555-2525 228-555-7778
228-555-2526 228-555-7879


 
Use some string functions and trim it. If you programmed in qbasic before this shouldn't be a problem.

-Laughter works miracles.
 
MaxEd,

thanks for your response. But I tried RTrim(lastname), RTrim(firstname) in the on print properity list and it did not work.
 
I didn't mean to trim it. You might need to write code to figure out the spaces and manually calculate the tabs.

-Laughter works miracles.
 
How are ya cotton . . .

[blue]Access does not maintain trailing spaces in fields[/blue], but for what you want to do you'll have to append a variable length number of spaces to the name, address,City/State/Zip fields, as well as a fixed number for the phone field. All to maintain tab positions.

Also, its not just a simple loop in code here, as you have to print a row of names first, then addresses and so on. Further complications are dictated by how many addresses you can print across a page (portrait/landscape).

So yes, I agree with [blue]cotton[/blue], you'll have to incorperate a spacing schema in your code.

The basic idea in [blue]setting the printing position to the next tab[/blue] would be (assuming the next tab position is 20):
Code:
[blue][purple][b]TextFieldName[/b][/purple] & Space(20 - Len([purple][b]TextFieldName[/b][/purple]))[/blue]
If you have enough fields . . . you have some work to do . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top