?
Solved

Auto Size font in fixed text box

Posted on 2012-03-29
7
Medium Priority
?
1,973 Views
Last Modified: 2012-03-30
I am working in Access on a report which will create employee badges.  All the text boxes and labels are a fixed size.

When selecting a font for the employee name, I want to select the largest font available for the text box, however I have no way of knowing how long or short the length of any given name will be.

Does access have a format to resize text in a text box so that no matter how long the string of text is, the font will resize to fit the name in current text box?
0
Comment
Question by:MCaliebe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 300 total points
ID: 37784692
No.
You would have to develop your own rules for the font size based on trial and error.
0
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 300 total points
ID: 37785602
I had the same dilemma before when I made a report for creating sale tags.  I originally developed my own rules as peter57r mentioned.  However when they wanted the tags to look even fancier I discovered a function created by Stephen Lebans called RotateText that made it easy.  In this particular instance I didn't use it to rotate my labels but just to resize them.  It can create a label at runtime that can be a specific size and the text will adjust proportionally.  
     If you want to go this route then here's the link to his site where you could download his function in a sample database:

http://www.lebans.com/rotatetext.htm
0
 

Author Comment

by:MCaliebe
ID: 37786838
I've done general code, tables, query, ect but this seems way over my head. IrogSinta, do you have an example of the rule you used?  I'm not looking for anything fancy...simple font size change is about it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 400 total points
ID: 37787007
This is a common question here with no easy answer.

<I want to select the largest font available for the text box,>
Consider this, ...this is 20 characters:
iiiiiiiiiiiiiiiiiiii
...but so is this:
WWWWWWWWWWWWWWWWWWWW
...so how what size font would you use for "20" characters?
What size would a text box be to hold "20" characters?

What about the font "Style" (not just the number of characters...)
20 characters in Times new Roman is not the same size as the same text in Arial.

So, no, there is no "Size Text to Box" feature in Access.

I have seen algorithms that "try" to do this, but they are all approximations and never really work as desired,  and require a lot of tweaking
(Because they all have to use some sort of "Average Font",...some names will be slightly chopped of, other will be a bit to small)
...and generally not worth the trouble IMHO.

If it were me I would simply make the Name textboxes as wide as the paper stock allows, then set the "Can Grow" Property to "Yes" and simply let really long names wrap.

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37787198
<When selecting a font for the employee name, I want to select the largest font available for the text box, >
Let's be clear here...
You want to select a different Font *Style* (Arial, Times New Roman, Comic Sans,...etc)
..or change the font *Size* (10 pt, 12 pt, 20 pt)
Or both...?, ...or neither, more something else entirely...?

Please post a clear graphical example of two extremes and the *EXACT* output you want.
0
 

Author Comment

by:MCaliebe
ID: 37787250
Thanks for everyones input.  I can see the compexity involved here and I will be taking the simple approach ...select a font, size and use it until it doesn't work.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37787636
Yes, also remember that the "Size" of the font effects the Height and Width
so again,  no easy answers here.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question