Dynamic formatting

R

rogge

I am trying to create a gray box to help indicate a table in a report. I am
using two lines to help determine the height of the box, a rectanglte.

box01.Height = line02.Top - line00.Top

The lines are moved depending on the height of the data between them; the
"can grow" property of the text boxes is set to yes. When the report is run,
the height is calculated using the lines original positions.

I tried the On Print event trigger, but the 2191 Run Time error occurs: "You
can't set height property in print preview or after printing has started."

any ideas? thankyou

I looked at the dynamic/conditional page break post, but that was of no
help...
Thanks again!
 
M

Marshall Barton

rogge said:
I am trying to create a gray box to help indicate a table in a report. I am
using two lines to help determine the height of the box, a rectanglte.

box01.Height = line02.Top - line00.Top

The lines are moved depending on the height of the data between them; the
"can grow" property of the text boxes is set to yes. When the report is run,
the height is calculated using the lines original positions.

I tried the On Print event trigger, but the 2191 Run Time error occurs: "You
can't set height property in print preview or after printing has started."


You can't do it that way for exactly the reason you found.

Instead, use the Print event to draw the lines and box using
the Line method:

Me.Line (txtbox.Left,txtbox.Top) - Step(0,txtbox.Height)

Me.Line (txtbox.Left,txtbox.Top) -
Step(txtbox.Width,txtbox.Height), vbBlack, BF
 

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