How to synchronize the height of cells in the same row? (1 Viewer)

yunhsuan

Member
Local time
Today, 14:44
Joined
Sep 10, 2021
Messages
50
Hello~
I've set the Can Grow property to Yes for all controls in the Detail section. This make the height of specific cell grows, but the height of other cell maintains. It looks weird when the border of cells are shown.
I tried to refer to https://www.access-programmers.co.u...ng-row-height-for-all-fields-in-a-row.248388/, but nothing worked in my file.
This is the code recommended in this report:
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
'Duane Hookom 3.18.2008
   
    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 each control 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), vbBlack, B
                'Me.DrawWidth = 6  'play with this number to make line thicker
        End If
        Next
End Sub
I'm not sure which is control name in this example I should change according to the control name in my file.
Can anyone tell me where I should change? Or is there any example file?
Thanks in advance!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:44
Joined
Oct 29, 2018
Messages
17,177
Hi. See if this could be an option for you.

 

yunhsuan

Member
Local time
Today, 14:44
Joined
Sep 10, 2021
Messages
50
Hi. See if this could be an option for you.

This is similar to what I want. But I don't want the space between two cells. Is there method to remove the space?
I want my table look like this one.
 

Attachments

  • 1.jpg
    1.jpg
    68.4 KB · Views: 47

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:44
Joined
Oct 29, 2018
Messages
17,177
This is similar to what I want. But I don't want the space between two cells. Is there method to remove the space?
I want my table look like this one.
Hi. Did you look at Figure #6 in the blog article? Is that what you mean?
 

Users who are viewing this thread

Top Bottom