While printing name tags from names in a database, a name is occasionally
too long to fit the text box using the prefered font size. How can I sense
overflow and reduce the font size for this particular name tag?
Sam
Code in Report module:
Option Compare Database
Dim A, B, C, D As Integer
Option Explicit
_____________________________________________________
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
A = Len([Text2]) 'Full Name
B = Len([Text3]) 'Street Address
C = Len([Text4]) 'City, State Zip
D = 0
D = IIf((A >= B And B < C And A >= C), A, D)
D = IIf((A >= B And B > C And A > C), A, D)
D = IIf((A >= B And B < C And A < C), C, D)
D = IIf((A < B And B > C And A > C), B, D)
D = IIf((A < B And B < C And A < C), C, D)
D = IIf((A < B And B > C And A < C), B, D)
[Reports]![Avery 8160 Labels]![Text2].FontSize = IIf(D > 30, 9, IIf(D >
25, 10,
11))
[Reports]![Avery 8160 Labels]![Text3].FontSize = IIf(D > 30, 9, IIf(D >
25, 10,
11))
[Reports]![Avery 8160 Labels]![Text4].FontSize = IIf(D > 30, 9, IIf(D >
25, 10,
11))
End Sub