Printing Mailing Labels

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My Application creates labels used to id products to be shipped to customers.
It works very nicely, except when a customer's name is exceptionally long
and when combined with other required info on the line, forces the text to
wrap which then caused everything to get out of sych.

I can't limit the length of text at the input stage, this data is used
through out the application and is needed in its entirety. I have two
thoughts. First, I thought there must be a way to get the system to truncate
the last (right most) field, rather than wrap. Second, although this is
probably much more complicated, get the system to reduce the font size based
on the total number of characters on a line.

Any help is greatly appreciated
 
My Application creates labels used to id products to be shipped to customers.
It works very nicely, except when a customer's name is exceptionally long
and when combined with other required info on the line, forces the text to
wrap which then caused everything to get out of sych.

I can't limit the length of text at the input stage, this data is used
through out the application and is needed in its entirety. I have two
thoughts. First, I thought there must be a way to get the system to truncate
the last (right most) field, rather than wrap. Second, although this is
probably much more complicated, get the system to reduce the font size based
on the total number of characters on a line.

Any help is greatly appreciated

I would be very careful about truncating a customer's name.
Names are important.
Sending a mailing to Alphonso Castelnu
when his name is really Alphonso Castelnuevo-Tedesco is not going to
win you any brownie points.

However, if you still wish to do so, assuming the FirstName and
LastName fields are concatenated into one control, you could use and
unbound Text control.
Set it's control source to:

= Left([FirstName] & " " & [LastName],17)

to always limit the name to the first 17 characters.

To alter the FontSize is easy enough.
Code the Report's Detail section Format event:

If Len(Me.[ControlName]) > 35 Then
Me.[ControlName].FontSize = 8
Else
Me.[ControlName].FontSize = 10
End If
 
Wow that's great!! Thanks so much. I will use the code to change font size.
Lele
--



fredg said:
My Application creates labels used to id products to be shipped to customers.
It works very nicely, except when a customer's name is exceptionally long
and when combined with other required info on the line, forces the text to
wrap which then caused everything to get out of sych.

I can't limit the length of text at the input stage, this data is used
through out the application and is needed in its entirety. I have two
thoughts. First, I thought there must be a way to get the system to truncate
the last (right most) field, rather than wrap. Second, although this is
probably much more complicated, get the system to reduce the font size based
on the total number of characters on a line.

Any help is greatly appreciated

I would be very careful about truncating a customer's name.
Names are important.
Sending a mailing to Alphonso Castelnu
when his name is really Alphonso Castelnuevo-Tedesco is not going to
win you any brownie points.

However, if you still wish to do so, assuming the FirstName and
LastName fields are concatenated into one control, you could use and
unbound Text control.
Set it's control source to:

= Left([FirstName] & " " & [LastName],17)

to always limit the name to the first 17 characters.

To alter the FontSize is easy enough.
Code the Report's Detail section Format event:

If Len(Me.[ControlName]) > 35 Then
Me.[ControlName].FontSize = 8
Else
Me.[ControlName].FontSize = 10
End If
 
Hello Fred,
I started to apply the code to vary font size based on the control length
when I realized, it is the sum of the several controls on the line that I
need to compare to. In other words the line on my label is [Company Name]&"
"&[Client Name]&" "&[Room]&" "&[PO number]. If the sum total length of those
fields exceeds 35 characters then I need a font size of 8.

Does this make things allot more complicated?
Thanks again.
Lele
--
Lele


fredg said:
My Application creates labels used to id products to be shipped to customers.
It works very nicely, except when a customer's name is exceptionally long
and when combined with other required info on the line, forces the text to
wrap which then caused everything to get out of sych.

I can't limit the length of text at the input stage, this data is used
through out the application and is needed in its entirety. I have two
thoughts. First, I thought there must be a way to get the system to truncate
the last (right most) field, rather than wrap. Second, although this is
probably much more complicated, get the system to reduce the font size based
on the total number of characters on a line.

Any help is greatly appreciated

I would be very careful about truncating a customer's name.
Names are important.
Sending a mailing to Alphonso Castelnu
when his name is really Alphonso Castelnuevo-Tedesco is not going to
win you any brownie points.

However, if you still wish to do so, assuming the FirstName and
LastName fields are concatenated into one control, you could use and
unbound Text control.
Set it's control source to:

= Left([FirstName] & " " & [LastName],17)

to always limit the name to the first 17 characters.

To alter the FontSize is easy enough.
Code the Report's Detail section Format event:

If Len(Me.[ControlName]) > 35 Then
Me.[ControlName].FontSize = 8
Else
Me.[ControlName].FontSize = 10
End If
 
Hello Fred,
I started to apply the code to vary font size based on the control length
when I realized, it is the sum of the several controls on the line that I
need to compare to. In other words the line on my label is [Company Name]&"
"&[Client Name]&" "&[Room]&" "&[PO number]. If the sum total length of those
fields exceeds 35 characters then I need a font size of 8.

Does this make things allot more complicated?
Thanks again.
Lele

There is a difference between a control (which displays data on a form
or report) and a field (which stores data in a table).

Are you attempting to print mailing labels?

The Control source of the text control is set to:
=[Company Name]&" "&[Client Name]&" "&[Room]&" "&[PO number]

The mailing label data, when displayed, is looking like this (all on
one line)? ...
Edison Electric Co. John Smith Room 115 PO#9876

All you need do is code exactly as I suggested. It's the name of the
one control that contains the data above. The names of the fields used
in the expression are irrelevant for what you are wanting to do.

If you mean you have 4 separate controls placed on that line (then
what do you mean by using & " " & etc.?) you need to change to one
control using the control source expression, as shown above.

You want one control that displays the data from the 4 different
fields.
 
Thanks! I am a little embrassed to say, almost as soon as I sent off my last
questions and I realized the answer was still as you originally suggested.

Again, I have already implemented and works great.
--
Lele


fredg said:
Hello Fred,
I started to apply the code to vary font size based on the control length
when I realized, it is the sum of the several controls on the line that I
need to compare to. In other words the line on my label is [Company Name]&"
"&[Client Name]&" "&[Room]&" "&[PO number]. If the sum total length of those
fields exceeds 35 characters then I need a font size of 8.

Does this make things allot more complicated?
Thanks again.
Lele

There is a difference between a control (which displays data on a form
or report) and a field (which stores data in a table).

Are you attempting to print mailing labels?

The Control source of the text control is set to:
=[Company Name]&" "&[Client Name]&" "&[Room]&" "&[PO number]

The mailing label data, when displayed, is looking like this (all on
one line)? ...
Edison Electric Co. John Smith Room 115 PO#9876

All you need do is code exactly as I suggested. It's the name of the
one control that contains the data above. The names of the fields used
in the expression are irrelevant for what you are wanting to do.

If you mean you have 4 separate controls placed on that line (then
what do you mean by using & " " & etc.?) you need to change to one
control using the control source expression, as shown above.

You want one control that displays the data from the 4 different
fields.
 
Back
Top