troubleshooting Question

Access 2016 Reports Section Header Visible

Avatar of Bob Collison
Bob CollisonFlag for Canada asked on
Microsoft Access
4 Comments1 Solution23 ViewsLast Modified:
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-Shutdown.
'Step 990-Exit Event.
Exit Sub
'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.
   Resume STEP_990   'Step 990-Exit Event.
End If
End Sub

How can I trigger the code?

Bob C.
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros