SteveL13
asked on
How make data in a text field dynamically change size to fit the size of the text field?
I have a field on a report that cannot be set to grow due to restrictions of the overall report size.. But I want the text in the field to be set at 16 pt. size by default but reduce in size to fit the size of the text box when necessary. Can this be done?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
With greater it worked.
Select Case Len(Me.txtMetal)
Case Is < 25
Me.txtMetal.FontSize = 15
Case Is > 25
Me.txtMetal.FontSize = 10
Case Else
End Select
Select Case Len(Me.txtMetal)
Case Is < 25
Me.txtMetal.FontSize = 15
Case Is > 25
Me.txtMetal.FontSize = 10
Case Else
End Select
place the codes in the Format event of the Section where the textbox is.
if text box is in the Detail section, use
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
select case len(me.textboxname)
case is < 25
me.textboxname.fontsize=12
case is < 15
me.textboxname.fontsize=16
case else
end select
end sub
you have to do several test to find whic setting will work for you