4
votes

Is it possible to have a report with flexible text width and height? I sometimes have two words in this text and some times hundreds. I want to have small text for the first and big text for the second. How do I do that?

2
Is there a field in a query that can be referenced to determine the size you want of the textbox? You can either choose to resize the textbox at run time via VBA, or you can have 2 different text boxes and set the Visible property in conjunction with which field you are using.Mark C.
This sounds like the exact same question from the following thread, which supplied a good answer. social.msdn.microsoft.com/Forums/office/en-US/…AVG

2 Answers

2
votes

I would advise you to set a your text box size to what you think is optimum and use the CanShrink and CanGrow properties (tap the text box and then open the properties windows and you can find them there).

The CanGrow property indicates whether the size of the text box can increase vertically according to its content. Similarly, CanShrink decreases the height of the text box according to its content. Here is a link for better understanding these two properties.

1
votes

Use the Detail_Format event.

It fires before each line, and you can change the formatting based on the length of the text.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Len(Field1) < 10 Then
        txtField1.FontSize = 18
    Else
        txtField1.FontSize = 12
    End If
End Sub