Label Printing Jumping to Second Line

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top