Reference sub-report detail textbox

G

Guest

Good evening,

I am having trouble getting the right synthax to retrieve the height of a
textbox in a subreport. This is what I have but it doesn't work. I don't
get any errors, it just doesn't give the proper values. When I debug.print
on the value it remains constants even though the field size changes
throughout the report.

lngHeight = Me.Report1.Report.Text6.Height

Thank you for the help,

Daniel
 
D

Duane Hookom

The grown height would only be available in the On Print of the section of
the subreport.
 
G

Guest

If I have 5 text boxes side by side and one is actually a subreport. How can
I manage to create line (borders) based on the max height of the tallest
textbox? How do you validate the subreport height in conjunction with the
textboxes directly in the main report?

Daniel
 
D

Duane Hookom

Are you looking for "the height of a textbos in a subreport" or "the
subreport height"?

If I understand correctly, you can use code in the On Print of the section
containing the text boxes and subreport to find the tallest. Then use the
Line method of the report to draw rectangles around all text boxes and the
subreport.
 
G

Guest

Duane,

Here are the details...

I have a report with 5 textboxes. I then have a subreport with 1 textbox
which is lined up beneath the 3rd textbox on the main form. I need to create
the appearance of a continuous table based on maximum total height.
Therefore I need to compare textboxes 1,2,4,5 and (3+subreport textbox
height) and the create the lines. Back to the original question in proper
context now. How can I determine the height of the subreport textbox to make
mathematical comparison with in the main report?

Thank you for your help,

Daniel
 
D

Duane Hookom

So, you don't care about the height of the text box in the subreport, just
the resulting height of the subreport. You can find the grown height of the
controls (the subreport is a control) with code in the On Print event of the
main report section containing the controls.

Dim lngMaxHeight as Long
If Me.txtOne.Height > lngMaxHeight Then
lngMaxHeight = Me.txtOne.Height
End If
If Me.txtThree.Height + Me.sbrptOne.Height) > lngMaxHeight Then
lngMaxHeight = Me.txtThree.Height + Me.sbrptOne.Height
End If
' use the Line method to draw rectangles around the
' controls setting the height to lngMaxHeight

There is a sample that uses this solution in the calendar report at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4
 

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