Field size in reports

  • Thread starter Thread starter setabery
  • Start date Start date
S

setabery

I have seen printed reports where the field size on the report does
not have enough space to print the value in the field. The first part
of the value in the field is printed and then an ellipis (...) is
inserted indicating that there is more but not enough room to print
it. Can this be done in Access and if so, how?
 
I have seen printed reports where the field size on the report does
not have enough space to print the value in the field. The first part
of the value in the field is printed and then an ellipis (...) is
inserted indicating that there is more but not enough room to print
it. Can this be done in Access and if so, how?

Determine the max characters you'd like to show and call that number M
(I use the dummy name Myfield. Replace that with your own field name)

Make the source of the text box be this:

=IIf(Len([Myfield]) > M, Left([Myfield], Len([Myfield]) - M - 5) & "(...)",
[Myfield])

Tom Lake
 
I have seen printed reports where the field size on the report does
not have enough space to print the value in the field. The first part
of the value in the field is printed and then an ellipis (...) is
inserted indicating that there is more but not enough room to print
it. Can this be done in Access and if so, how?


Not sure what you're talking about, but if you are using a
text box control to display the value, then just open the
report in design view and change the text box's Width to
whatever size you want.
 
Gee, that makes a lot more sense than how I read the
question.

Note that proportional fonts can make the Len function near
useless when a close fit is needed. For a more precise
measurement of the length of a formatted text string, use
the TextWidthHeight function at www.lebans.com
--
Marsh
MVP [MS Access]


Tom said:
I have seen printed reports where the field size on the report does
not have enough space to print the value in the field. The first part
of the value in the field is printed and then an ellipis (...) is
inserted indicating that there is more but not enough room to print
it. Can this be done in Access and if so, how?

Determine the max characters you'd like to show and call that number M
(I use the dummy name Myfield. Replace that with your own field name)

Make the source of the text box be this:

=IIf(Len([Myfield]) > M, Left([Myfield], Len([Myfield]) - M - 5) & "(...)",
[Myfield])
 
Back
Top