Box does not grow with txt fields

R

RoadKyng

Afternoon'

I have a report that has three stacked txt fields in the Detail section, all
with the 'can grow' attribute set to 'yes'. These fields are each on a line
by themselves. I have the following code on the 'On Print' event for the
Detail section:

Me.DrawWidth = 80

Me.Line (0, 0)-Step(Me.Width, Me.Section(0).Height), , B

The problem is the box does not grow with the fields as it should. The
report prints task cards. Normally, there is room for (4) task cards per
page. However there are times when the fields are wuite lengthy and as little
as (1) task card can print per page. When this happens (1) box will print
with the test flowing through and below it.

What might I have wrong?
 
M

Marshall Barton

RoadKyng said:
Afternoon'

I have a report that has three stacked txt fields in the Detail section, all
with the 'can grow' attribute set to 'yes'. These fields are each on a line
by themselves. I have the following code on the 'On Print' event for the
Detail section:

Me.DrawWidth = 80

Me.Line (0, 0)-Step(Me.Width, Me.Section(0).Height), , B

The problem is the box does not grow with the fields as it should. The
report prints task cards. Normally, there is room for (4) task cards per
page. However there are times when the fields are wuite lengthy and as little
as (1) task card can print per page. When this happens (1) box will print
with the test flowing through and below it.


The section's Height property has not been changed. You
need to use Me.Height to get its height after it grows.
 
R

RoadKyng

I don't completely understand.
Are you saying I must determine the final height of the three text boxes
after they have grown and use this figure to set the final height of the text
box?
or
I have not properly set the height attribute of the text box?

I have not been able to find proper documentation on this method. I am using
Access 2003. Is it in the Help files or is there some other source?

Thanks for your time
 
R

RoadKyng

Marshall,
a follow-up.

when I look at the code line "Me.Line (0, 0)-Step(Me.Width,
Me.Section(0).Height), , B"

it appears to me to be saying 'draw a line starting at point 0,0 (X,Y axis)
and step (lengthen) it the final width and final height of the Detail section
of the report, whatever that ends up being'. By your response my
interpretation is incorrect. Can you enlighten?

The width is fine, it's the height that is the issue
 
M

Marshall Barton

RoadKyng said:
when I look at the code line "Me.Line (0, 0)-Step(Me.Width,
Me.Section(0).Height), , B"

it appears to me to be saying 'draw a line starting at point 0,0 (X,Y axis)
and step (lengthen) it the final width and final height of the Detail section
of the report, whatever that ends up being'. By your response my
interpretation is incorrect. Can you enlighten?


Sorry for confusing you. What I was trying to say is that
Access does not change the section's Height property when
the section grows. The thing that is updated to contain the
section's new height is the report's Height property.

That may seem odd at first glance, but form/reports do not
really have a Height property. A form's total height (see
InsideHeight and WindowHeight) is determined by the sum of
the each form section's height. More relevant to you, a
report's total height doesn't really have any meaning at
all, so a report's Height property is available for
something else. The folks that created Access decided to
make a section's final grow/shrink height available through
the report's Height property. Confusing as that may be, you
can get what you want by using:

Me.Line (0, 0)-Step(Me.Width, Me.Height), , B

Just to totally muddy the waters on this topic, since A2003,
you can change a report section's Height property in its
Format event by using:
Me.Section(n).Height = <new height value>
However, this is only useful is some unusual situations
unrelated to what you are trying to accomplish.
 

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