"Underlay following section" command in Access?

G

Guest

Does Access have anything similar to Crystal Report's "Underlay following
sections" command? I'd like a group header to occupy the same space as the
following details for that group (like two overhead transparencies laying on
top of each other).

Or... I'm trying to code the On Format property to shade every other group
header section, the way you can shade every other detail section. I have
successfully shaded every other row in the detail section with the online
tutorial at

http://office.microsoft.com/en-us/assistance/HA012191461033.aspx

And I've tried to modify the code to apply to the Group Header section, but
without success. It may be fairly simple for you VB gurus to modify the code
for the Group Header section. What I want to accomplish is a Group Header
and its following Details section to have the same shading, alternating with
the next Group Header and its Details section having a different shading.
I.e., a Group Header + Details in white, followed by a Group Header +
Details in Light Gray.

Any ideas/input would be greatly appreciated.
TIA,
Steve Vincent
(e-mail address removed)
 
M

Marshall Barton

Steve said:
Does Access have anything similar to Crystal Report's "Underlay following
sections" command? I'd like a group header to occupy the same space as the
following details for that group (like two overhead transparencies laying on
top of each other).

Or... I'm trying to code the On Format property to shade every other group
header section, the way you can shade every other detail section. I have
successfully shaded every other row in the detail section with the online
tutorial at

http://office.microsoft.com/en-us/assistance/HA012191461033.aspx

And I've tried to modify the code to apply to the Group Header section, but
without success. It may be fairly simple for you VB gurus to modify the code
for the Group Header section. What I want to accomplish is a Group Header
and its following Details section to have the same shading, alternating with
the next Group Header and its Details section having a different shading.
I.e., a Group Header + Details in white, followed by a Group Header +
Details in Light Gray.


To get the details to print on top of the group header, add
a line of code to the group header section's Format event
procedure:
Me.MoveLayout = False

To color every other group header, add code like this to the
group header section Format event procedure:

If Me.groupheader0.BackColor = vbWhite Then
Me.groupheader0.BackColor = RGB(220,220,220)
Else
Me.groupheader0.BackColor = vbWhite
End If

This same logic can be used in the detail section's Format
event to color alternate details.
 
J

John Spencer

One small modification to Marshall's suggestion.

In the detail section, I would try the following - you did say you wanted
all the details to be the same color as the associated group header.

Me.Detail.BackColor = Me.groupheader0.BackColor
 
G

Guest

The shading code -- right on the money, thank you! The "underlay" code
(Me.MoveLayout = False) seems to be hiding every other row, and compressing
the rows too much. I might have to play with the Can Grow/Shrink properties.

Thanks all for your input!

Steve Vincent
(e-mail address removed)

John Spencer said:
One small modification to Marshall's suggestion.

In the detail section, I would try the following - you did say you wanted
all the details to be the same color as the associated group header.

Me.Detail.BackColor = Me.groupheader0.BackColor
 
M

Marshall Barton

It sounds like you placed the MoveLayout line of code in the
detail section. Make sure it's in the GROUP HEADER
section's Fomat 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