Link "Can Grow" to other controls

G

Guest

I'm stuck recreating Excel reports in Access. I want an entire row of
controls to grow based on the "Can Grow" height of the tallest control, or at
least the one most likely to be tallest.

Ideally, I'd like all the row's controls to "Can Grow" AND "Can Shrink" to
fit the information queried.

Don't know if it's possible, but THANKS!
Doug
 
D

Duane Hookom

Why do you want all the controls to grow? I think your issue is that you are
displaying borders and would like nice rectangles that are all the same
height. If this is correct, remove all borders and use the Line method of
the report in the On Print event of the report section to calculate the
tallest control and then draw boxes around all controls.

I have used a solution where you enter "Border" into the tag property of
each control in the details section that you want to draw a rectangle
around.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim intMaxHeight As Integer
Dim ctl As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
If ctl.Height > intMaxHeight Then
intMaxHeight = ctl.Height
End If
End If
Next
'Draw a box around all controls in Detail _
that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), , B
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