Link to home
Start Free TrialLog in
Avatar of bgothard
bgothard

asked on

Access 2003 Report - Conditional Formatting of Font Size

Hello all.
MS Access 2003 SP2
This database fills blanks on a US Customs form.  The Port Director has asked that I increase the font size on the entry fields so that it is easier to read when the fax is received.  (I know, there are 100 ways to email it and get a "pretty" copy, but they require the fax.)
Increasing the font size causes some records to extend beyond the allotted space on the form, cutting off portions of the data.
For example:  "Dublin, Ireland" fits fine, but "Purfleet, United Kingdom" gets cut off.
1) I cannot wrap the text.
2) I cannot modify the alloted size of the field.

I would like for the control to use font size 12 for everything that will fit, and either 11 or 10 based on the length of the data.  (I have determined that 10 is the smallest necessary.)

What I need is some combination of conditional formatting and whatever flags the "Can Grow" attribute.

I need to get this in production immediately, so any ideas will be greatly appreciated.
Avatar of frankytee
frankytee
Flag of Australia image

i'm confused, do you mean form or report?
ASKER CERTIFIED SOLUTION
Avatar of grendel777
grendel777
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bgothard
bgothard

ASKER

Sorry.  It is an Access REPORT.  

The end result is a US Customs and Border Protection FORM 7512. (Official name.)  In this context, please ignore references to "form".  
Have you tried using Arial Narrow size 12.  The letters are bigger, but not as wide.

If not, in the OnFormat event of the section where the field is. you can test for the len() and change the font size of the text box accordingly.  The len() is not perfect as we are not using proportional font, but is an easy alternative.
Thanks Grendel777!  That worked like a charm.  I added an ElseIf to step down through 11 to 10.  It's not a perfect solution because I'm using Arial, but it solves the problem with a minimum of fuss. (And isn't that what it's all about anyway?)

Kudos!

I appreciate the suggestion, ragoran, and I'll keep it in mind.  I already implemented Grendel777's solution before I read yours.  (The code, not the font.  The narrow font doesn't fax well, either.  I tried that earlier and they didn't like it.  Good suggestion, though.)

Thanks again!