Form - variable length af a textfield (help)

D

Dzjoepke

I have a form referencing a table (that has a memo-field)
In the form I want to have the height of this memofield to be adjusted
according to the value it has. So it could be that it is a continuous
text from approx 7 lines or could be a text with 'enter's. How can I
adapt the height of my textfield on the form according to the number of
lines from my textfield?
Joepie.
 
M

Marin Kostov

Use the Can Shrink and Can Grow Property of hte text box.
CanGrow expands the text box vertically to fit the data in the field when
the form or report is printed.

CanShrink reduces the text box vertically if there is no data in the field
when the form or report is printed.

Note When you set the CanGrow property to Yes for a text box, Microsoft
Access automatically sets the CanGrow property of the section to Yes.
(From the Help)
 
S

Stephen Lebans

See:
http://www.lebans.com/textwidth-height.htm
TextHeightWidth.zip is a replacement for the Report object's TextWidth
and TextHeight methods. It is multiline aware and can work in both
Report and Form views. Includes a sample report to show you how to
autosize individual controls with different formatting on the same line
to simulate RTF style text.



History

Version 4.5: Increased accuracy of auto sizing for a ListBox.

Version 4.3: Added sample Form to demonstrate auto sizing for a ListBox.

Version 4.2: Added report to demonstrate auto sizing to mix text
formatting on one row.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
T

TC

He wants it to work when the form is >displayed<. CanGrow/Srink will not
work for that.

HTH,
TC
 
D

Dzjoepke

OK, thanks
I was first trying this on a form, and I noticed that nothing changed,
but now I got it working in my Report.
So everything is ok!
Thank you again!
Joepie.
 

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