Remove spaces between text

Jeanette

Registered User.
Local time
Today, 02:21
Joined
Dec 17, 2001
Messages
52
Hello
How do I remove spaces between text that is concatenated. I tried using LTrim and RTrim but that did not work. Here is the expression I am currently using: Trim([Buildings_Crosstab]![1] & " " & [Buildings_Crosstab]![2] & " " & [Buildings_Crosstab]![3] & " " & [Buildings_Crosstab]![4] & " " & [Buildings_Crosstab]![5] & " " & [Buildings_Crosstab]![6] & " " & [Buildings_Crosstab]![7] & " " & [Buildings_Crosstab]![8] & " " & [Buildings_Crosstab]![9] & " " & [Buildings_Crosstab]![10] & " " & [Buildings_Crosstab]![11] & " " & [Buildings_Crosstab]![12] & " " & [Buildings_Crosstab]![14] & " " & [Buildings_Crosstab]![16] & " " & [Buildings_Crosstab]![17])
 
Trim([Buildings_Crosstab]![1]) & " " & Trim([Buildings_Crosstab]![2]) & " " & Trim([Buildings_Crosstab]![3]) & " " & Trim([Buildings_Crosstab]![4]).......

[This message has been edited by Jack Cowley (edited 12-24-2001).]
 
Are you telling me to use the Trim() function to remove spaces between strings of text? If you are, I am currently using the Trim() function, but the spaces are not removed.
 
The Trim() function removes leading and trailing spaces from a string. The code that I am suggesting (Trim([Buildings_Crosstab]![1])) would remove leading and trailing spaces from the string [Building_Crosstab]![1], etc. The code you are using will remove the leading and trailing spaces from your concatenated string only. You have added spaces in your concatenation by using the & " " & to concatenated your string. If these are the spaces you are wanting to remove then Trim([Buildings_Crosstab]![1] & [Buildings_Crosstab]![2] & [Buildings_Crosstab]![3] & .... should do the trick.

If [Buildings_Crosstab]![1] contains a string like "Now is the time" and you want to remove the space in that string then you will need to use code to remove the spaces before you do your concatenation or you will need to run the code after the concatenation.

hth,
Jack

[This message has been edited by Jack Cowley (edited 12-27-2001).]
 
I did what you recommended and it worked.
Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom