Question:
Microsoft Access: format text box according to amount of characters?
2014-06-01 14:42:06 UTC
Hello,

I have a MS Access database with a report that makes badges out of the data stored in a database.
There is a text box for Name, Institution and Function. What is happening currently: whenever a Name / Institution name or Function name is longer than x characters, the text is cut off at the end of the text box. I want the respective text boxes to expand in size (e.g. a new text line is created under the first one, and text boxes below the text box that needs more space automatically move down). Is there any way to do this without just moving the text boxes further away from each other and having a huge space between the text boxes?

Visual:

Tom Smith
University of Amsterdam, F| (text cut off)
Guestspeaker

to:

Tom Smith
University of Amsterdam,
Faculty of Law
Guestspeaker


Thanks in advance.
Three answers:
john h
2014-06-03 23:53:42 UTC
I would make some new calculated fields in the query the report is based on. This fields do not need you to change your data (table) but act like a field from your table. Have Line1, Line2,Line3,Line4,Line5 as your fields. To make these I would use an iif statement in the field and count characters in the fields and if to big extract just the words less then your character count or over for the normally blank lines. Which means you should allow a space for the data in the report rather then expecting it to drop a line IE.: If info

is short.



Tom Smith

University Am.





Guestspeaker



If long.



Tom Smith

University of

Amsterdam,

Faculty of Law

Guestspeaker
Blackened
2014-06-01 17:12:12 UTC
Set the 'Can Grow' property of the textbox to Yes. Still, you'd be left with the situation of how to control where the line breaks occur. I think a better solution would be to separate the Name, University, Title, and Functions fields (like the previous answerer mentioned).



Then you could set a one textbox's can grow to yes and the control source to

=([Name]+chr(13)+chr(10)) & ([University]+chr(13)+chr(10))...etc. This way if any of the field are null, there won't be a line break. Or, you could set the can grow property and can shrink properties for each control.
?
2014-06-01 14:43:53 UTC
Format it so the title field is on a separate line.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...