Removing unwanted spaces in a text box

Crackers

Registered User.
Local time
Tomorrow, 07:43
Joined
May 31, 2002
Messages
36
I have two questionaire forms in a database. There are no tables or queries involved.
The answers to each questionaire are compiled into text boxes, one on each Form. On the main form I have another text box that puts all the answers together so that this can be transferred to another program. An example of what is in each text box is as follows:

Text1: IIf([Check325]=True,[Combo77] & " " & [Combo59] & " " & [Text65] & " " & [Text69],"") & " " & IIf([Check329]=True,[Combo78] & " " & [Combo61] & " " & [Text66] & " " & [Text70],"")

Text2: IIf([Check326]=True,[Combo102] & "" & [Combo188] & " " & [Combo91] & " " & [Text94] & " " & [Text97],"") & " " & IIf([Check330]=True,[Combo103] & " " & [Combo92] & " " & [Text95] & " " & [Text98],"")

These are just small extractions. My problem is, if an answer is not necessary in the first lot of text, but an answer has been supplied in the second lot, how do I remove the spacing that has resulted from my Formula in Text1. -

e.g: Normal answers would show perhaps
Yes Twice 16 25 Red Peter Ford Football 1965 - Whereby the first 4 answers are from Text1 and the remaining answers from Text2.
If some answers are not necessary from Text1 I would get the following result:
SPACE SPACE SPACE Twice Red Peter Ford Football 1965

Any assistance would be gratefully accepted.
 
Rickster57 said:
See if using LTRIM and/or RTRIM helps you out.

Or maybe just a plain TRIM()?
 
if your comboboxes return null then
Text1: IIf([Check325]=True,[Combo77] + " " & [Combo59] + " " & [Text65] + " " & [Text69],"") + " " & IIf([Check329]=True,[Combo78] + " " & [Combo61] + " " & [Text66] + " " & [Text70],"")

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom