Draw rectangle based on subreport

Q

Question Boy

I am trying to create a rectangle around a certain area in a report that is
variable/dynamic based on a subreport and for some reason cannot get the
proper height of the subreport to pass to the function drawing the rectangle.


Using the Detail_Print event I have

Dim iheight As Long
If Me.rpt_tbl_dtFabP.Report.Height > Me.rpt_tbl_dtApproP.Report.Height
Then
iheight = 900 + Me.rpt_tbl_dtFabP.Report.Height
Else
iheight = 900 + Me.rpt_tbl_dtApproP.Report.Height
End If

should this not work? how can I determine the height of the subreport,
record by record?

QB
 
D

Duane Hookom

I doubt you want to refer to the ".Report." since you are only concerned
about the grown height of the control and not anything about the object in
the control.

I would try
Dim iheight As Long
If Me.rpt_tbl_dtFabP.Height > Me.rpt_tbl_dtApproP.Height Then
iheight = 900 + Me.rpt_tbl_dtFabP.Height
Else
iheight = 900 + Me.rpt_tbl_dtApproP.Height
End If
 
Q

Question Boy

Duane,

I don't quite understand, I thought that the .Report height would give me
the total height taken by the subreport.... What do you mean object in the
control? Sorry to be a bother. Is there a section in the help that explains
this properly that I missed?

One way or another, your solution worked like a charm!!!!

Thank you,

QB
 
D

Duane Hookom

It's fairly simple. I Report object doesn't have a height property. A report
has a record source and some other stuff. Controls and sections have height.
Your subreport container is a cntrol. You can grab its height.
 
Q

Question Boy

Now if some of the help files were written in plain english like that there
might be hope for people like me. Thank you for dumbing it down to my level.
I acually understand. I guess it becomes easier to understand the more you
do...

QB
 
D

Duane Hookom

Glad to hear I made it understandable. I some times reply with too short of
answers that are technically correct but don't do anything to educate readers.
 

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