Turn off Group header and turn on Page Header

G

Guest

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
 
M

Marshall Barton

Cat's Meow said:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
G

Guest

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

Marshall Barton said:
Cat's Meow said:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
M

Marshall Barton

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
--
Marsh
MVP [MS Access]


Cat's Meow said:
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?

Cat's Meow said:
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.
Marshall Barton said:
I think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
G

Guest

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

Marshall Barton said:
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
--
Marsh
MVP [MS Access]


Cat's Meow said:
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?

Cat's Meow wrote:
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.
Marshall Barton said:
I think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
M

Marshall Barton

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.
--
Marsh
MVP [MS Access]


Cat's Meow said:
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.


Marshall Barton said:
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


Cat's Meow said:
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?


Cat's Meow wrote:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
G

Guest

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
Marshall Barton said:
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.
--
Marsh
MVP [MS Access]


Cat's Meow said:
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.


Marshall Barton said:
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


Cat's Meow wrote:
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?


Cat's Meow wrote:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
M

Marshall Barton

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.
--
Marsh
MVP [MS Access]



Cat's Meow said:
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)


Marshall Barton said:
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.
--
Marsh
MVP [MS Access]


Cat's Meow said:
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.


:
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


Cat's Meow wrote:
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?


Cat's Meow wrote:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
G

Guest

Marshall,

Thank you very much. You have solved my problem.

Kudos to your manager!
Tom

Marshall Barton said:
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.
--
Marsh
MVP [MS Access]



Cat's Meow said:
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)


Marshall Barton said:
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.
--
Marsh
MVP [MS Access]


Cat's Meow wrote:
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.


:
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


Cat's Meow wrote:
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?


Cat's Meow wrote:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 
M

Marshall Barton

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 ;-))
--
Marsh
MVP [MS Access]


Cat's Meow said:
Marshall,

Thank you very much. You have solved my problem.

Kudos to your manager!
Tom

Marshall Barton said:
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.
--
Marsh
MVP [MS Access]



Cat's Meow said:
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)


:
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.
--
Marsh
MVP [MS Access]


Cat's Meow wrote:
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.


:
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


Cat's Meow wrote:
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?


Cat's Meow wrote:
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 think you can just do away with the page header and set
the group header section's RepeatSection property to Yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top