Can Grow Subreport doesn't Move a Rectangle

K

Kari

I have a pretty straightforward report with a subreport in the detail section
set to Can Grow. When it grows it pushes the textboxes (and their labels)
below it, down accordingly. So far, so good.

The problem is that I have a rectangle around those textboxes, which doesn't
get moved. Is there a way to make the rectangle move, as well?

Poking around the boards I found a way to draw the rectangle in at the On
Print event, but that seems so much more complicated. I'm hoping someone out
there can tell me how to get the doggone rectagle to move! :)

Thanks for all your help,

Kari
 
K

Kari

Chuck,

Thanks for your reply. Unfortunately, the text boxes I need to put a box
around, are on the main report, not the subreport (sorry for the confusion).
The text boxes in question are located below the subreport and get moved as
the subreport changes size.

I have put a new, unbound, text box on the report, and used it to make the
rectangle I need. Although this works, it strikes me as a bad idea; who
knows what kind of unexpected mischief an idle text box can get up to?

Any further ideas would be most welcome.

Kari
 
K

Kari

Chuck said:
Can you put the text boxes in question in their own sub report that is placed
under the existing sub report?

Unless you absolutely must have a rectangle around the text boxes, just draw a
horizontal line above and below the text boxes. The horizontal lines will move
as the sub report grows or shrinks. If you draw vertical lines on the sides,
(to make a rectangle) the tops of the vertical lines will also move to stay
aligned with the top horizontal line, however their length will not grow as the
'rectangle' expands vertically. If the 'rectangle' does not grow, you may be
home free.

Don P. Mellon has written code for a module that will draw a vertical line
between two variable points.

* * * * * * *
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Copyright Don P. Mellon
' Comment:
On Error GoTo ErrorHandler
Dim X1 As Single
Dim Y1 As Single
Dim X2 As Single
Dim Y2 As Single
Dim Color As Long

' Set measurement to inches, line width in pixels, black line color, and Y
values.
Me.ScaleMode = 5
Me.DrawWidth = 5
Color = RGB(0, 0, 0)
Y1 = -0.01
Y2 = 21 'actual vertical length will end at bottom of the Detail section.

'Draw line 1.
X1 = 0.1
X2 = 0.1
Me.Line (X1, Y1)-(X2, Y2), Color
'Draw line 2.
X1 = 8.1
X2 = 8.1
Me.Line (X1, Y1)-(X2, Y2), Color

ExitRoutine:
Exit Sub
ErrorHandler:
MsgBox Err.Description
Resume ExitRoutine
End Sub
* * * * * *

Chuck

Chuck,

Thank you, thank you, thank you!! Can you tell it worked? :)

The textboxes inside the rectangle don't change size, so I was able to draw
four lines and it works. Why lines move but a rectangle doesn't is beyond
me, but this method works and I am much happier not using brute force (i.e.
an empty textbox). Thank you for helping me to find a better way.

Kari
 
E

Eka1618

Hi Chuck, I do not know if you are following this thread anymore, but I am
sort of having a similar problem with subReports grow and shrink property.

I have 3 subReports that are all set to grow and shrink. In Report View,
subReports overlap each other, In Print View, they grow and shrink
accordingly.

Do you know why this happens? I have used horrizontal line to see if that
would help, but it still does the same thing. I have to allow my users to
view reports in Report View before printing.

Please let me know if you have any thoughts, Thank You!
 

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