Expanding Borders?

H

Homer

I have a report with about ten text boxes in a section. I need a border (Box)
around the section of ten boxes displayed in my report. The problem I am
having is the bottom text box is 'Can Grow' and does, but the border does not
grow with it. Is there a solution to keep the box around my section of text
boxes even when it grows?
 
D

Duane Hookom

You can use code in the On Print event of the section to draw lines using the
report's Line method. Use this method to draw the complete rectangle or use
horizontal lines at the top and bottom of the section and draw two vertical
lines with the Line method.
 
H

Homer

I drew the top and bottom horizontal lines and know this approach is what I
need, but I have looked for info on drawing the vertical lines using code and
have not found much on it. I would appreciate any help I could get from you
on what the code might look like to accomplish this. I don't have a good
grasp on how to position the start and finish of the vertical lines. Thanks
for all the help.
 
H

Homer

Ok, I normally don't post code because I'm sure there's a better way, but
there were no replys to my request for help, so I'll post in case someone out
there needs a little help. This is the code I used to draw two vertical lines
between two horizontal lines. This allows a box border to expand according to
the data. It seems to be workin for me.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim ctl As Control
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Btm" Then
Z = ctl.Top - 190
End If
Next
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Tp" Then
DrawWidth = 20
Me.Line (ctl.Left + 10, 170)-Step(0, Z)
Me.Line (ctl.Left - 40 + ctl.Width, 170)-Step(0, Z)

End If
Next

End Sub
 

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