Change Font Size in a Sub Report Text Box

Manged

Registered User.
Local time
Today, 08:50
Joined
Jun 30, 2010
Messages
10
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
 
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
 
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.
 

Users who are viewing this thread

Back
Top Bottom