UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Stop Repeating Group Headers For Every Detail, Access 2016    
 
   
LLCadet
post Jul 15 2019, 11:14 AM
Post#1



Posts: 6
Joined: 22-May 19



After creating a step sequence from this thread, I'm now trying to produce a report based off of the data. The data is formatted as follows:

Action taken, the section for that action (Sections 0 through 4), and the step sequence (the order in which events need to occur).

Grouping, however, is rather strange. When I sort by Step Sequence, it displays the section header above each and every action that appears instead of grouping it all appropriately under a single banner. If I group by section first, it displays appropriately but does not follow the proper Step Sequence order. I also must make certain that the sections do not break across pages. Here are a few pictures to show the difference:

Attached File  GroupRepeating.JPG ( 73.55K )Number of downloads: 8
Attached File  GroupOutOfOrder.JPG ( 62.28K )Number of downloads: 7


The first picture, the sections are displaying for every action. The second picture, the section at the top is section 0 but it does not follow the step sequence of the actions (please ignore the number to the left--an old calculating field that needs to be removed).

I look forward to any advice that can be provided. My manager came up with some VBA that allowed the group header to be hidden for "duplicating values"; unfortunately, it breaks the section across pages.
Go to the top of the page
 
LLCadet
post Jul 23 2019, 11:02 AM
Post#2



Posts: 6
Joined: 22-May 19



Update:

I took my manager's coding and tweaked it a bit to check for a new page. Here's the workaround...

CODE
Option Compare Database
Private headsec As Integer

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    
    If Me.txtSectionID <> headsec Then
        Me.GroupHeader1.Visible = True
    Else
        Me.GroupHeader1.Visible = False
    End If
    
    headsec = Me.txtSectionID
End Sub

Private Sub Report_Load()

    headsec = 9000
End Sub

Private Sub Report_Page()

    headsec = 9000
End Sub


This code allows the group header to disappear when it's not needed and reappear when it is, simply by checking what "sectionID" (group) is being formatted and seeing if it changed from the previous one being processed.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th August 2019 - 12:36 AM