Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Group Footer Textbox Height 1

Status
Not open for further replies.

Ray1127

Programmer
Feb 22, 2002
231
US
I have an Access 2000 report That has a group Footer In the Group footer there are several Textboxes 2 of which have the cangrow set to yes. I need to set all of the textboxes in that footer to the same height as the largest of the 2. If I put the code in the format event of the group header nothing changes. If I put it in the Print Event I get an error stating that the hieght cannot be changed at that point.

Anybody have an idea how I can accomplish this?
 
You need to set the border to transparent and then use code in the On Print event of the Group Footer to draw the rectangles using the Line method.
This is code I used in the Detail Section. I set the tag property of each control I wanted to outline to "Border".
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim intMaxHeight As Integer
    Dim ctl As Control
[green]    'Find highest control in Detail section _
      that has a tag property of "Border"[/green]
    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
[green]    'Draw a box around each control in Detail _
      that has a tag property of "Border"[/green]
    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
        
        End If
    Next
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top