Repeating Group in report

  • Thread starter Dale_Fye via AccessMonster.com
  • Start date
D

Dale_Fye via AccessMonster.com

I've got a report group that contains a #, Title, and a Description.

I would like to print the # and Title at the top of each page where the
Detail section pertains to this group, but I don't want to repeat the
Description.

I know I've done this before, think it has to do with putting some code in
the group headers format event, but don't remember how I did it.

Thanks, in advance

Dale
 
M

Marshall Barton

Dale_Fye via AccessMonster.com said:
I've got a report group that contains a #, Title, and a Description.

I would like to print the # and Title at the top of each page where the
Detail section pertains to this group, but I don't want to repeat the
Description.

I know I've done this before, think it has to do with putting some code in
the group headers format event, but don't remember how I did it.


If you can set the group's KeepTogether property to With
First Detail, or Whole Group then you can check if the group
header will be followed by the first detail or some other
detail. Add a text box (named txtDetilsNum) and set it's
expression to =1 and RunningSum to Over Group. Then add a
line of code to the group header section Format event:

Me.txtDescription.Visible = (Me,txtDetilsNum = 1)
 
D

Dale_Fye via AccessMonster.com

Marshall,

You're a genius.

Another question.

Assume that the maximum length of a grouping of the report is 2 pages, but
that some are only one page long. I'd like to be able to setup the report so
that each grouping starts on an odd page, so that when I print the report
double sided, and bind it, each group starts on the right hand page.

Basically, what this involves is printing a blank page before a group if the
group is going to start printing on an even page.

Does that make sense?

Dale

Marshall said:
I've got a report group that contains a #, Title, and a Description.
[quoted text clipped - 4 lines]
I know I've done this before, think it has to do with putting some code in
the group headers format event, but don't remember how I did it.

If you can set the group's KeepTogether property to With
First Detail, or Whole Group then you can check if the group
header will be followed by the first detail or some other
detail. Add a text box (named txtDetilsNum) and set it's
expression to =1 and RunningSum to Over Group. Then add a
line of code to the group header section Format event:

Me.txtDescription.Visible = (Me,txtDetilsNum = 1)
 
A

Al Campagna

Dale,
# is not a legitimate field name, so I'll use the name IDNo
When you display IDNo, Title, and Description in the report
header, is that 3 fields concatenated together?
Example...
= IDNo & " " & Title & " " & Description

If so... then an unbound text control in the Header section with...
= IDNo & " " & Title
While it is possible to set a header value during the OnFormat
event, that doesn't appear necessary, given the info you've provided
so far.

If not... please provide more information about your fields
and setup.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
D

Dale_Fye via AccessMonster.com

Al,

Three separate fields. The ID and Title are on the same line, the
Description is right below them and stretches across the entire width of the
report (with Can Grow) set to true.

I briefly tried the technique Marshall recommended, but I must have been
doing something wrong, as the # increased for each group, and if there were
multiple pages within a given group, it stayed the same within the group.
Have a lot of competing demands on my time today, so have not had a real good
opportunity to focus on this.

Dale

Al said:
Dale,
# is not a legitimate field name, so I'll use the name IDNo
When you display IDNo, Title, and Description in the report
header, is that 3 fields concatenated together?
Example...
= IDNo & " " & Title & " " & Description

If so... then an unbound text control in the Header section with...
= IDNo & " " & Title
While it is possible to set a header value during the OnFormat
event, that doesn't appear necessary, given the info you've provided
so far.

If not... please provide more information about your fields
and setup.
I've got a report group that contains a #, Title, and a Description.
[quoted text clipped - 8 lines]
 
D

Dale_Fye via AccessMonster.com

Finally got a chance to actually work on this, and got it to work.

Thanks again, Marshall.

Dale_Fye said:
Marshall,

You're a genius.

Another question.

Assume that the maximum length of a grouping of the report is 2 pages, but
that some are only one page long. I'd like to be able to setup the report so
that each grouping starts on an odd page, so that when I print the report
double sided, and bind it, each group starts on the right hand page.

Basically, what this involves is printing a blank page before a group if the
group is going to start printing on an even page.

Does that make sense?

Dale
[quoted text clipped - 10 lines]
Me.txtDescription.Visible = (Me,txtDetilsNum = 1)
 
M

Marshall Barton

Which part did you get to work? Hiding the description,
starting each group on an odd page or both?
--
Marsh
MVP [MS Access]


Dale_Fye via AccessMonster.com said:
Finally got a chance to actually work on this, and got it to work.

Dale_Fye said:
Another question.

Assume that the maximum length of a grouping of the report is 2 pages, but
that some are only one page long. I'd like to be able to setup the report so
that each grouping starts on an odd page, so that when I print the report
double sided, and bind it, each group starts on the right hand page.

Basically, what this involves is printing a blank page before a group if the
group is going to start printing on an even page.
I've got a report group that contains a #, Title, and a Description.
[quoted text clipped - 10 lines]
Me.txtDescription.Visible = (Me,txtDetilsNum = 1)
 
D

Dale_Fye via AccessMonster.com

Hiding the description.


Marshall said:
Which part did you get to work? Hiding the description,
starting each group on an odd page or both?
Finally got a chance to actually work on this, and got it to work.
[quoted text clipped - 13 lines]
 
M

Marshall Barton

Dale_Fye via AccessMonster.com said:
Hiding the description.


You can start each group on an odd page by adding a Page
Break control (named pgBreak) at the bottom of the group
footer and using a line of code in its Format event:

Me.pgBreak.Visible = (Me.Page Mod 2 = 1)
 
D

Dale_Fye via AccessMonster.com

Thanks Marshall, that will be a great help

Marshall said:
You can start each group on an odd page by adding a Page
Break control (named pgBreak) at the bottom of the group
footer and using a line of code in its Format event:

Me.pgBreak.Visible = (Me.Page Mod 2 = 1)
 
M

Marshall Barton

I guess I should say that in some situations, you may need
to put the page break control at the top of the group header
section. In this case, the line of code would be:

Me.pgBreak.Visible = (Me.Page Mod 2 = 0)

But, the extra page will have the new group's data in the
page header/footer sections and during the Page event.
 

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