I cannot get anything from Debug.Print.
I put a messagebox in instead just so I can see what it returns.
I also tried:
If Me.Transaction_Group = "Repurchase Agreement" Then
It does the same thing as
If Me.Section("GroupHeader3").Controls("Transaction_G roup") = "Repurchase Agreement" Then
Whichever way I go, the controls that I make not visible - are not visible for all sub groups. They simply don't show on the report.
Code:
Private Sub GroupFooter3_Format(Cancel As Integer, FormatCount As Integer)
If Me.Section("GroupHeader3").Controls("Transaction_Group") = "Repurchase Agreement" Then
'If Me.Transaction_Group = "Repurchase Agreement" Then 'This works too.
Debug.Print Me.Section("GroupHeader3").Controls("Transaction_Group") 'This doesn't show anything in the immediate window.
MsgBox "Tran Group = " & Me.Transaction_Group 'Shows Repurchase Agreement.
Me.Section("GroupFooter1").Visible = False 'Totally hides the control from all sections.
' Me.Section("GroupFooter3").Visible = False 'Totally hides the control from all sections.
Else
Me.Section("GroupFooter3").Visible = True
End If
End Sub