Format Based on Height

G

Guest

I need to know if this is possible, as I'm having some difficulty with it.

I have a report that has a 'notes' section based on a memo field for user
input. The notes section has to fit in a box that is 1" tall. If it runs
over 1", I want the bottom 1/4" to be covered up by a label that reads
"Continued on Back".

The report is exactly as tall as the page allows.

Here was my original idea.

Have the notes field in two places, txtNotes and txtNotesB. txtNotes would
be in the designated spot, exactly 1" tall, with the CanGrow and CanShrink
properties set to "No". txtNotesB would be in the page footer section, its
CanGrow and CanShrink poperties set to "Yes" I would have a label
lblContinued, with a white background which overlaps the bottom 1/4" of the
txtNotes field. I would have a white box exactly 3/4" high at the top of
txtNotesB. I would use the following code in the Detail_Format section

If txtNotesB.Height > 1440 Then
PageFooter.Visible = True
lblContinued.Visible = True
Else
PageFooter.Visible = False
lblContinued.Visible = False
End If

However, when I use this code, it always uses the initial value of
txtNotesB, rather than calculating the value based on the field's current
height. Is there some other way to do this, or maybe a way to count the
number of lines in the field?
 
M

Marshall Barton

Vel. said:
I need to know if this is possible, as I'm having some difficulty with it.

I have a report that has a 'notes' section based on a memo field for user
input. The notes section has to fit in a box that is 1" tall. If it runs
over 1", I want the bottom 1/4" to be covered up by a label that reads
"Continued on Back".

The report is exactly as tall as the page allows.

Here was my original idea.

Have the notes field in two places, txtNotes and txtNotesB. txtNotes would
be in the designated spot, exactly 1" tall, with the CanGrow and CanShrink
properties set to "No". txtNotesB would be in the page footer section, its
CanGrow and CanShrink poperties set to "Yes" I would have a label
lblContinued, with a white background which overlaps the bottom 1/4" of the
txtNotes field. I would have a white box exactly 3/4" high at the top of
txtNotesB. I would use the following code in the Detail_Format section

If txtNotesB.Height > 1440 Then
PageFooter.Visible = True
lblContinued.Visible = True
Else
PageFooter.Visible = False
lblContinued.Visible = False
End If

However, when I use this code, it always uses the initial value of
txtNotesB, rather than calculating the value based on the field's current
height. Is there some other way to do this, or maybe a way to count the
number of lines in the field?


A major problem with your approach is that the Page header
and footer section can not grow. You have to come up with a
totally different way to spill the txtNotesB text box to the
next page.

Another problem is that you can not determine the CanGrow
height of a text box at the time of the Format event and the
Print event is too late to do much about it. Thanks to
Stephen Lebans, this is easily overcome by using his
TextHeightWidth function at www.lebans.com

I'd make some alternate suggestions, but I just don't know
enough about your report's requirements to be effective.

Think about all this, then try to refine your approach and
post back with a more detailed question about whatever
trouble you run into.
 
G

Guest

Thanks for your help.

I was mistaken in my description of the problem; I had the second 'page' for
notes in my ID footer section. I was able to use that function from
www.lebans.com to do what I needed succesfully and dynamically.

Thank You

.... and Thank You Mr. Lebans...
 

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