Need extra detail sections

kroenc17

Registered User.
Local time
Today, 13:34
Joined
Sep 22, 2010
Messages
31
I'm making a report that needs to have more than one detail section.. one for each group I create.

Each group shows a different activity: Projects, Misc., Special Assignments.

The header for each group shows different captions (in bold on the attached picture) which differ depending on which activity it is.. for example, Projects have an End Date, Misc. do not. Each Header section needs it's own Details section and this will work perfectly.

The details section shows the actual data. I don't know how to create separate details sections, my Access 2007 for Dummies book is saying they should be created automatically.. maybe I'm doing something wrong?

Thanks for the help.
 

Attachments

  • report.jpg
    report.jpg
    99.5 KB · Views: 109
What we do at my current job is use a TAB control which is set to the correct tab in the detail section's FORMAT event based on the current information in one of the fields in the detail section's records.
 
Oh, and the tab control is used without tabs and formatted flat with no border so it doesn't look any different from the page.
 
I just need to have a detail section for every group I create and it will work perfectly. Is that possible?
 
I just need to have a detail section for every group I create and it will work perfectly. Is that possible?

Nope, with Access you get ONE (unlike Crystal Reports). So the tab control (or subreports depending on what works for your situation) are the two ways you can go.
 
Maybe you can help me, Bob.. I'm overwhelmingly new to Access so forgive me.. the instructions with the tab method wen't completely over my head. I see the Format event but beyond that I'm lost. This creates separate tabs at the top of the report?

I've attached the report and design view of the report I need to make. What I need is exactly what's there, except I need to have three different headings (the headings show the Activity Type in blue, and my captions in bold). Projects, Misc. Special Assignments are the headings. They're all going to have slightly different captions, and which data is shown.

Sorry for the MS Paint!
 

Attachments

  • 1.jpg
    1.jpg
    87.9 KB · Views: 121
  • 2.jpg
    2.jpg
    97.4 KB · Views: 114
The TAB CONTROL is added to the detail section. The TAB CONTROL ICON looks like this:

attachment.php


Then you set the Tabs property to NONE like this:

attachment.php



And then in your Format event you use something like this code:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  ' Comments  :
  ' Created   : 02/17/04 by JC
Dim ctl As Access.Control
On Error GoTo Errors
'Make the relevant controls visible for the sections(s) needed
For Each ctl In Me.tabDetail.Pages
    If Not (ctl.Tag = "") Then
        ctl.Visible = InStr(1, ctl.Tag, Me.txtStatus_ID)
    End If
Next ctl
ExitHere:
    Exit Sub
Errors:
    Select Case Err.Number
        Case Else
             MsgBox "Unexpected Event " & Err.Number & " - " & Err.Description, , "Procedure - Detail_Format"
    End Select
Resume ExitHere
End Sub
That code uses a field in the report's record source query that tells it which status we want. So, based on that status (numbers 1 to 13 for my report) it shows the controls which have their tag property set to the appropriate number. So page 1 would have its tag set as 1 and then each control on page 1 of that tab control would also have a 1 in the tag property.

Oh, and since you removed the tabs from the tab control you navigate to each page by using the dropdown here:

attachment.php
 

Attachments

  • tabcontrol.jpg
    tabcontrol.jpg
    9.2 KB · Views: 278
  • tabstyle.jpg
    tabstyle.jpg
    48 KB · Views: 278
  • tabnavigate.jpg
    tabnavigate.jpg
    33.9 KB · Views: 285
Okay thanks Bob, I'll have a crack at this on Monday
 
Also, you might look into using sub reports as those may work fine for you. This is primarily if you have different sections which require different controls on them to display the data right.
 

Users who are viewing this thread

Back
Top Bottom