Avatar of Bob Collison
Bob Collison
Flag for Canada

asked on 

Access 2016 Reports Section Header Visible

Hi Experts,

I have a report that contains multiple Header / Footer Sections.

Based on a Criteria I want to make then visible or invisible.

To do this I have created the following code that I believe should be triggered as each record is read however the code is never triggered.  i.e. The MsgBox never displays.

[code]Private Sub Report_Current()
On Error GoTo STEP_999
MsgBox "Step 000-Report On Current Event - R-46-010"
'As Of: 2020/07/12.
If SELECTION_30 = "Summary" Then
   GroupHeader1.Visible = "False"
   GroupHeader0.Visible = "False"
   GroupHeader2.Visible = "False"
   GroupFooter4.Visible = "False"
   GroupFooter5.Visible = "False"
   GoTo STEP_900   'Step 900-Shutdown.
ElseIf SELECTION_30 <> "Summary" Then
   GroupHeader1.Visible = "True"
   GroupHeader0.Visible = "True"
   GroupHeader2.Visible = "True"
   GroupFooter4.Visible = "True"
   GroupFooter5.Visible = "True"
   GoTo STEP_900   'Step 900-Shutdown.
End If

STEP_900:
'Step 900-Shutdown.
STEP_990:
'Step 990-Exit Event.
Exit Sub
STEP_999:
'Step 999-Form Error Handler Code.
Dim DebugErrMsgOpt999 As String
DebugErrMsgOpt999 = "Yes" 'Un-Comment for use.  '**
If DebugErrMsgOpt999 = "Yes" Then
   MsgBox Err.DESCRIPTION & " (" & Err.Number & ")"
   Resume STEP_990   'Step 990-Exit Event.
Else
   Resume STEP_990   'Step 990-Exit Event.
End If
End Sub

How can I trigger the code?

Thanks,
Bob C.
Microsoft Access

Avatar of undefined
Last Comment
Dale Fye

8/22/2022 - Mon