Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

Turn off Group header and turn on Page Header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cat's Meow - 10 Jan 2006 01:56 GMT
I have created a report that needs to print a group header for page 1 of the
customer and then print page headers while the customer stays the same.  When
the customer changes, I don't need the Page Header to print, just the Group
Header.   This is really important and I'm trying to figure
out if it something I have to do in VBA or if it something that can easily be
done within the Report program within Access. The hierarchy of my report is:

Sort By: Customer - Product Group - Product
Group By: Customer - Product Group

This is how my report prints right now:

{No Report Header

Customer Name {Customer Header Fields
Address
City, State zip
Phone

Product Q1 Q2 Q3 Q4 {Customer Header Labels
ProductX xx xx xx xx {Detail Records

[Page 2, Same Customer]

Product Q1 Q2 Q3 Q4 {Page Header
ProductX xx xx xx xx {Detail Records

[Page 3, New Customer]

Product Q1 Q2 Q3 Q4 {Page Header

Customer Name {Customer Header Fields
Address
City, State zip
Phone

Product Q1 Q2 Q3 Q4 {Customer Header Labels
ProductX xx xx xx xx {Detail Records

And therein is my problem. Because the page header prints on the new page
AND my Customer Header prints because it is a new customer, my column
headings print twice. I want my page three to look like this for a new
customer:

[Page 3, New Customer]

Customer Name {Customer Header Fields
Address
City, State zip
Phone

Product Q1 Q2 Q3 Q4 {Customer Header Labels
ProductX xx xx xx xx {Detail Records

Thanks for your quick response.
Tom
Marshall Barton - 10 Jan 2006 06:17 GMT
>I have created a report that needs to print a group header for page 1 of the
>customer and then print page headers while the customer stays the same.  When
[quoted text clipped - 38 lines]
>AND my Customer Header prints because it is a new customer, my column
>headings print twice.

I think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.

Signature

Marsh
MVP [MS Access]

Cat's Meow - 10 Jan 2006 11:21 GMT
Marsha,
Thanks for your quick response!  If I turn on the RepeatSection property,
that will print all of my customer header information on every page.  To
conserve report space, I only want my customer information to print on page 1
of the new customer.  On page 2, 3, etc within the same customer I want the
column labels to print for Product, Q1, Q2, Q3, Q4 detail.  But when the
customer changes, I don't need these labels at the top of the page because
they are already included within the Customer Group Header.  

Is there a way I can attach the output of my report to show you the issue
I'm having?

I appreciate your help and will look forward to your response.
Tom

> >I have created a report that needs to print a group header for page 1 of the
> >customer and then print page headers while the customer stays the same.  When
[quoted text clipped - 41 lines]
> I think you can just do away with the page header and set
> the group header section's RepeatSection property to Yes.
Marshall Barton - 10 Jan 2006 16:29 GMT
I don't know about Marsha, but I don't have time to dig into
someone else's database.

I think you can get what you want by adding a line of code
to the group **footer** section's Format event procedure:
    Me.Section(3).Visible = False

Then, you can turn the page header back on in the group
**header**
    Me.Section(3).Visible = True
Signature

Marsh
MVP [MS Access]

>Marsha,
>Thanks for your quick response!  If I turn on the RepeatSection property,
[quoted text clipped - 53 lines]
>> I think you can just do away with the page header and set
>> the group header section's RepeatSection property to Yes.
Cat's Meow - 10 Jan 2006 20:40 GMT
Marshall that is great!  However, this is where I am weakest in Access --
defining event procedures.  Can you help me with the code to print a page
header and a group header?  If I can build the logic that says:

If GroupHeader is going to print
  Then don't print page header
 Else
   Print Page Header
   End-If

I just don't know the syntax to write those statements.  I'm trying to learn
VBA, but I have a long way to go.  Thanks in advance for the pointer.

Tom

> I don't know about Marsha, but I don't have time to dig into
> someone else's database.
[quoted text clipped - 63 lines]
> >> I think you can just do away with the page header and set
> >> the group header section's RepeatSection property to Yes.
Marshall Barton - 10 Jan 2006 21:35 GMT
The lines of code I posted do that.  

Because the next group header is going to be printed
following the current group footer, you do not need an If.
Just make the page header invisible.  (If you don't already
have a group footer, create it and set its Height to 0).

Conversely, since the next thing after a group header and
some details will be a page header, you can just make the
page header visible again.  On the other hand, if all of the
details fit on one page, the group footer will make it
invisible for the start of next group.

If your question is how to create the event procedures, just
click on the bar above the section in the report's design
view.  Then use the View - Properties menu item to display
the section's properties list.  Select the events tab in the
properties window and scan down the list to the OnFormat
property select [Event Procedure] for the property, then
click on the builder button [...] in the property's right
margin.  This will create a skeletal procedure if the
procedure didn't already exist.  It then places the cursor
in the procedure ready for you to enter code.
Signature

Marsh
MVP [MS Access]

>Marshall that is great!  However, this is where I am weakest in Access --
>defining event procedures.  Can you help me with the code to print a page
[quoted text clipped - 77 lines]
>> >> I think you can just do away with the page header and set
>> >> the group header section's RepeatSection property to Yes.
Cat's Meow - 11 Jan 2006 11:29 GMT
Marshall,
Thank you!  One last question.  Tell me what the syntax of this statement
means:

Me.Section(3).Visible=True

I understand the Visible = True, but why is it Me.Section(3)?  What doe the
Me.Section do?  What does the (3) represent (i.e. why is it 3, not 2, or 4)

Thanks Marshall for helping me learn the syntax.
Tom

> The lines of code I posted do that.  
>
[quoted text clipped - 100 lines]
> >> >> I think you can just do away with the page header and set
> >> >> the group header section's RepeatSection property to Yes.
Marshall Barton - 11 Jan 2006 17:03 GMT
Me is the object that contains the code, in this case the
report.

Section is a property of the report that returns the Section
object specified by the following index number.  See Help
for more details on this stuff, but in short, section 0 is
the detail section, 1 - Report Header, 2 - Report Footer,
3 - Page Header, 4 - Page Footer, 5 - first Group Header,
etc.

You can use the name of the section instead, e.g.
    Me.PageHeaderSection.Visible = True
but since you might have changed it to some other name, I
used Section(3) to eliminate any confusion.
Signature

Marsh
MVP [MS Access]

>Thank you!  One last question.  Tell me what the syntax of this statement
>means:
[quoted text clipped - 108 lines]
>> >> >> I think you can just do away with the page header and set
>> >> >> the group header section's RepeatSection property to Yes.
Cat's Meow - 12 Jan 2006 11:10 GMT
Marshall,

Thank you very much.  You have solved my problem.

Kudos to your manager!
Tom

> Me is the object that contains the code, in this case the
> report.
[quoted text clipped - 122 lines]
> >> >> >> I think you can just do away with the page header and set
> >> >> >> the group header section's RepeatSection property to Yes.
Marshall Barton - 12 Jan 2006 17:11 GMT
I'm glad to have been able to help solve your problem.

Manager?  What manager?  I don't need no stinking manager.
(my wife's opinion to the contrary  ;-))
Signature

Marsh
MVP [MS Access]

>Marshall,
>
[quoted text clipped - 129 lines]
>> >> >> >> I think you can just do away with the page header and set
>> >> >> >> the group header section's RepeatSection property to Yes.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.