Text box that expands horizontally

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.
 
L

Larry Linson

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
 
D

Duane Hookom

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

Jon M.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top