Anna, I follow you with the logic of combining several fields into one, so
it prints as one continuous sentence instead of the space of each individual
text box.
I don't understand the bit about A1 having a width of 20 and A2 a width of
10. That seems unnecessary if you are combining them into one text box. If
you set the text box's Can Grow property to Yes, it will grow to the desired
height vertically. But CanGrow/CanShrink have no effect on the horizontal
width of the text box.
If you really are trying to calculate how wide you need the text box to
handle the concatenated text, this page might help:
http://www.lebans.com/textwidth-height.htm
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
AnnaList said:
thanks for your response, however the problem persists.
Example - concatenate 2 fixed length fields A1 & " " & A2 where
A1 is 20 in width and value of Hello and
A2 is 10 and value World - it will look like this: Hello World.
I want to retain the field widths so it looks like Hello
World .
I used the Space function to add spaces at the end of A1 to equal the
difference between the length of the value inside A1 and 20.
I set the Can Shrink to No to make sure the text box is not trying to
collapse when I run the report.
The intermediate window, when I run the code it looks perfect - all the
spacing is correct.
The report looks bad because the spacing that I added in programming
doesn't
hold up.
I am stumped...
:
You can programmatically add a space between the fields.
There are 2 concatenation operators, + and &, and they handle Nulls
differently:
Null + " " = Null
Null & " " = " "
Therefore you can use:
=[FirstName] + " " & [Surname]
and it trims the space it the FirstName is Null.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Using Access2000, I am concatenating a number of fields in order to
compress
the printing of multiple lines to use as little vertical space as
possible.
(can grow) At issue is that Access automatically trims the text fields
so
line by line, fields don't up. I want to retain the field length when
I
concatenate these variables. It would solve all the formatting issues
that
are occurring. Is there a trick that i am missing?
Thanks for any advice you can offer.