Re: Can Grow Subreport doesn't Move a Rectangle

Tech-Archive recommends: Fix windows errors by optimizing your registry





"Chuck" wrote:

On Mon, 11 Aug 2008 15:39:01 -0700, Kari <Kari@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

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

"Chuck" wrote:

On Mon, 11 Aug 2008 09:38:20 -0700, Kari <Kari@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

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

Do not drawn a rectangle around the test boxes. Instead, set the Boarder Style
of the sub report to: Solid. Set the Boarder Width to: Hairline. Set the
Boarder color to: 0. That's zero for black, not letter O. The boarder will
grow, shrink, and move as required to keep all the text boxes inside.

Chuck

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
.



Relevant Pages

  • Re: My earlier post was Horizontal Line
    ... The code below is the exact of my Report module. ... It can draw the table ... starting point for the line or rectangle. ... QBColor function to specify the color. ...
    (microsoft.public.access.formscoding)
  • Re: Can Grow Subreport doesnt Move a Rectangle
    ... around, are on the main report, not the subreport. ... The text boxes in question are located below the subreport and get moved as ... The problem is that I have a rectangle around those textboxes, ... of the sub report to: ...
    (microsoft.public.access.reports)
  • Re: My earlier post was Horizontal Line
    ... I managed to get the code below from Access Report help. ... How do I improve on the above code to draw a Veritcal Fixed-height line. ... starting point for the line or rectangle. ... QBColor function to specify the color. ...
    (microsoft.public.access.formscoding)
  • Re: Can Grow Subreport doesnt Move a Rectangle
    ... around, are on the main report, not the subreport. ... The text boxes in question are located below the subreport and get moved as ... The problem is that I have a rectangle around those textboxes, ...
    (microsoft.public.access.reports)
  • Re: Extra detail format
    ... draw boxes, I use the On Page to draw a constant number of boxes. ... > It's working just like any page break of a report. ... Dim sngTop As Long ...
    (microsoft.public.access.reports)