Text Box Contents Disappear in Group Footer

  • Thread starter I''ve a feeling I''m not in Unix Anymore
  • Start date
I

I''ve a feeling I''m not in Unix Anymore

I have an unbound text box in a page header that gets its contents from code
on the page header print event. I found the code in this discussion group
and it works fine. When I copy the same text box and same print event code
into a group footer on a different report (all I change in the code is the
section name), the text box shows up, but it doesn't display any text. In
both cases, both the section and the text box properties are set to
"visible." I've played around with "can grow" and "can shrink" but they
don't change my results. Any help would be appreciated. Thanks in advance.

Here's the print event code I'm using for the text box in the page header:

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Dim strFirst As String
Dim strSecond As String
Dim strSeparator As String
Dim CtlDetail As Control

For Each CtlDetail In Me.Section(acPageHeader).Controls
If CtlDetail.Name Like "Legend*" Then
strFirst = "LAWYER"
strSecond = "Assistant"
strSeparator = " / "

With Me
' Create desired Font settings
' Underline all of the text in the control
' with a normal (not bold) line
.FontUnderline = True
' for the First String - Bold Text
.CurrentX = CtlDetail.Left
.CurrentY = CtlDetail.Top
.FontBold = True
' For some reason must be Me.Print not .Print
Me.Print strFirst;

' Reset Font-> NO Bold for Second String & Separator
.FontBold = False
.FontUnderline = True
Me.Print strSeparator;
Me.Print strSecond
End With
End If
Next
' Cleanup
Set CtlDetail = Nothing
End Sub

Here's the print event code I'm using in the group footer:

Private Sub GroupFooter0_Print(Cancel As Integer, PrintCount As Integer)
Dim strFirst As String
Dim strSecond As String
Dim strSeparator As String
Dim CtlDetail As Control

For Each CtlDetail In Me.Section(acGroupFooter0).Controls
If CtlDetail.Name Like "Legend*" Then
strFirst = "LAWYER"
strSecond = "Assistant"
strSeparator = " / "

With Me
' Create desired Font settings
' Underline all of the text in the control
' with a normal (not bold) line
.FontUnderline = True
' for the First String - Bold Text
.CurrentX = CtlDetail.Left
.CurrentY = CtlDetail.Top
.FontBold = True
' For some reason must be Me.Print not .Print
Me.Print strFirst;

' Reset Font-> NO Bold for Second String & Separator
.FontBold = False
.FontUnderline = True
Me.Print strSeparator;
Me.Print strSecond
End With
End If
Next
' Cleanup
Set CtlDetail = Nothing
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