Text box that expands horizontally

  • Thread starter Thread starter Jon M.
  • Start date Start date
J

Jon M.

Greetings all,
I have a report with three text boxes next to each other. What I would like
is for these text boxes to always have the same distance in between the text
when the report is being viewed. For example if boxA has "Cauliflower", boxB
has "Peas", and BoxC has "Green Beans Almondine" I would like the text boxes
to autofit to the length of text. So if next time boxA has "Peas" in it, it
will shrink to that size and move the other boxes over so they are next to
each other. Does that make sense? I know how to make them wrap so they
expand vertically but I am trying to avoid that. As always I appreciate any
help I can get. Thanks.
 
There is no built-in feature of Access to accomplish what you want. It is
possible with some non-trivial code, but most do not find it worth the time
and effort. I believe there was an article on such manipulation and font
metrics in one of the Access-oriented magazines a few years ago; it was only
of academic interest to me, so I don't remember much more. Chances are good
that someone has an article on their website that you can use to learn.

An alternative approach would be to concatenate the three values and display
the concatenated text string as a calculated Control. You could, if you
desired (and if you are using a font which provides one) use a special
character as a separator between the words... in many commonly-used fonts
there is a vertical bar, | , that might work.

Larry Linson
Microsoft Office Access MVP
 
Can you try use a single text box with properties like:
Name: txtVeggies
Control Source: =[Veggie1] & " " & [Veggie2] & " " & [Veggie3]
 
That is exactly what I needed! It is always the simple things that elude me
the most. Thank you.
--
Jon M.


Duane Hookom said:
Can you try use a single text box with properties like:
Name: txtVeggies
Control Source: =[Veggie1] & " " & [Veggie2] & " " & [Veggie3]

--
Duane Hookom
Microsoft Access MVP


Jon M. said:
Greetings all,
I have a report with three text boxes next to each other. What I would like
is for these text boxes to always have the same distance in between the text
when the report is being viewed. For example if boxA has "Cauliflower", boxB
has "Peas", and BoxC has "Green Beans Almondine" I would like the text boxes
to autofit to the length of text. So if next time boxA has "Peas" in it, it
will shrink to that size and move the other boxes over so they are next to
each other. Does that make sense? I know how to make them wrap so they
expand vertically but I am trying to avoid that. As always I appreciate any
help I can get. Thanks.
 
Back
Top