473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Auto fit text to a label

1
I want to dynamically resize text in a text box on an Access form. I did this several years ago, but have since forgotten how I did it. I even limited the font size to change between two sizes, such as 14 pt and 6 pt. This was very handy at times as one could often see everything without having to scroll.

Anyone have any ideas that can head me in the right direction?

Thanks,

Randy
May 2 '07 #1
2 5549
Rabbit
12,516 Expert Mod 8TB
You probably used Len() to determine how long the string was and then used a smaller font size for anything above a threshhold value.
May 2 '07 #2
JConsulting
603 Expert 512MB
something like this

Select Case Len(me.myfield)
Case < 12
Me.myfield.Properties("FontSize") = 16
Case < 14
Me.myfield.Properties("FontSize") = 14
Case < 16
Me.myfield.Properties("FontSize") = 12
Case < 18
Me.myfield.Properties("FontSize") = 11
Case < 20
Me.myfield.Properties("FontSize") = 10
Case < 22
Me.myfield.Properties("FontSize") = 9
Case < 24
Me.myfield.Properties("FontSize") = 8
Case Else
Me.myfield.Properties("FontSize") = 8
End Select


Adjust to suit a particular font.
J
May 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kathryn | last post by:
Hello, I am trying to read an xml file into a web page via vb.net. I am current using an rss format and reading it directly into a DataSet with the following command:...
0
by: Kathryn | last post by:
Hello, I am trying to read an xml file into a web page via asp.net. I am current using an rss format and reading it directly into a DataSet with the following command:...
0
by: Kathryn | last post by:
Hello, I am trying to read an xml file into a web page via vb.net. I am current using an rss format and reading it directly into a DataSet with the following command:...
3
by: Wenlei Fang | last post by:
Anybody knows how to accomplish this?
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
5
by: iKiLL | last post by:
Hi All, I am trying to Bulid Windows Mobile Forms Control with C# in VS2005 using CF2. On this control A lable is created and some text set for the control. My problem is that i dont know how...
3
by: bimgot | last post by:
hi i am using ms access to print some address labels using a thermal label printer. to do this i've combined and trimmed the name and address fields into one new field called "label" in order to...
0
by: gobblegob | last post by:
Well i cannont remember where i picked this code up, but i have seen it asked for in many forums, Many times so i thought i'd add it here (Since this is my favourite forum). Auto scroll text in...
2
by: paulyXvpf | last post by:
Hi All, FACTS: > I've created a VB.NET 2005 form, with a SQL Server 2000 backend > The form has about 30 fields that populate 30 columns in the SQL database > The form has mostly text feilds,...
1
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.