I
iholder
I am printing labels with Trim(LastName)+", "+Trim(FirstName) and HealthID
This all on one line. Is some cases the FirstName Field jumps to the
second line if the name is too long.
This is my code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'check if query has record before opening form
Dim strRecCount As Integer
strRecCount = DCount("*", "qryPrintLabels")
If strRecCount = 0 Then
Exit Sub
End If
If IsNull([ClientName]) Then Exit Sub
'if name is too long it prints "NAME TOO LONG'
If Len([ClientName]) > 26 Then
Me.ClientName.Visible = False
Me.LabelNameTooLong.Visible = True
Else
Me.ClientName.Visible = True
Me.LabelNameTooLong.Visible = False
End If
'if characters are more than 18 then smaller font is used.
If Len([ClientName]) > 18 Then
[ClientName].FontSize = 10
[HealthID].FontSize = 14
Else
[ClientName].FontSize = 14
[HealthID].FontSize = 14
End If
But in some cases 18 length maybe okay for smaller font or in other cases
the firsname still prints on the second line.
Is this because the font is proportional size.
Solution to this problem welcomed.
Thank You
Ileana
End Sub
This all on one line. Is some cases the FirstName Field jumps to the
second line if the name is too long.
This is my code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'check if query has record before opening form
Dim strRecCount As Integer
strRecCount = DCount("*", "qryPrintLabels")
If strRecCount = 0 Then
Exit Sub
End If
If IsNull([ClientName]) Then Exit Sub
'if name is too long it prints "NAME TOO LONG'
If Len([ClientName]) > 26 Then
Me.ClientName.Visible = False
Me.LabelNameTooLong.Visible = True
Else
Me.ClientName.Visible = True
Me.LabelNameTooLong.Visible = False
End If
'if characters are more than 18 then smaller font is used.
If Len([ClientName]) > 18 Then
[ClientName].FontSize = 10
[HealthID].FontSize = 14
Else
[ClientName].FontSize = 14
[HealthID].FontSize = 14
End If
But in some cases 18 length maybe okay for smaller font or in other cases
the firsname still prints on the second line.
Is this because the font is proportional size.
Solution to this problem welcomed.
Thank You
Ileana
End Sub