[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Auto Size font in fixed text box

Posted on 2012-03-29
7
Medium Priority
?
2,103 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

649 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