Same Height

C

CJ

Hi Groupies

All of my text boxes in the detail section are set to Can Grow. My problem
is that if one of the boxes needs to grow, I need the other text boxes to
grow to the same size. The box that usually needs to grow is called strName,
so I would like all of the other boxes to be the same height as strName when
the detail prints.

I am testing this with one of the other boxes and at the moment, I have the
following code, but nothing is changing:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Me.Package.Height = Me.strName.Height

End Sub

Some insight into the problem would be greatly appreciated.
 
D

Duane Hookom

As you may have found out, this won't work. The grown height of the text box
can't be determined until the On Print event. At that point it is too late to
set the height of other controls.

The common solution is to remove the borders from all text boxes and use
code in the On Print event to find the tallest text box. Then use the Line
method of the report to draw rectangles around all text boxes.

This question get answered several times per month so you should be able to
google
Access reports Me.Line On Print Hookom
If you don't find some code, let us know.
 
M

Marshall Barton

CJ said:
All of my text boxes in the detail section are set to Can Grow. My problem
is that if one of the boxes needs to grow, I need the other text boxes to
grow to the same size. The box that usually needs to grow is called strName,
so I would like all of the other boxes to be the same height as strName when
the detail prints.

I am testing this with one of the other boxes and at the moment, I have the
following code, but nothing is changing:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Me.Package.Height = Me.strName.Height

End Sub

Some insight into the problem would be greatly appreciated.


Check Print Lines at www.lebans.com
 

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