View Full Version : Change Font Size in a Sub Report Text Box


Manged
07-29-2010, 07:39 AM
What i want to do is change the font size of a text box that is in a sub report UNTIL the report is 1 page. Here is the code i have for finding the page number

Dim intTotalPages As Integer
Dim strMsg As String
intTotalPages = Me.[Pages]
strMsg = "This report contains " & intTotalPages & " pages."
If intTotalPages > 1 Then

MsgBox strMsg
'Change Font Size Here...

End If

Trevor G
07-29-2010, 08:19 AM
You would need to open the report in design view, then select the properties in the detail section, look at the events tab and select on format.

Somewhere beneath your code you would add the word me. this then will produce a list of objects you have in the report then select the object and add .fontsize = add your size here. Sample below



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.postoce.FontSize = 14
End Sub

Manged
07-29-2010, 10:05 AM
Ok, this looks like a good start. Thanks!
Any ideas on how to get it to change the font size until it fits to one page, and thats not just for decreasing it would be nice if it increased the font size the same way.