Show Field for First Record in Group Only

S

Simon Shutter

Hi Folks,

I want to add a header field to each group of records on a report. Normally
I can just create a header for that field but in this case I want to have
the header adjacent to the first record of the group and not above the
group.

My solution was to add two text boxes (txt1 and txt2) associated with a
numeric field common to the group. For txt1 I set the Running Sum property
to Over Group. I made both text boxes invisible since they were not needed
in the report output. Then I set the conditional formatting property of the
header field to Expression Is txt1.value <> txt2.value and the font color
to white. This has the following effect

header field txt1 txt2
xxxx (black) 1 1
xxxx (white) 2 2
xxxx (white) 6 3

Is there an easier, elegant way to do this?

Tx, Simon
 
D

Duane Hookom

I would make sure the header section and detail section are the same height.
Remove the extra control from the detail section. Then add code to the
Header Section On Format event:
Me.MoveLayout = False
 
S

Simon Shutter

Thanks, Duane - I'll try that


Duane Hookom said:
I would make sure the header section and detail section are the same
height. Remove the extra control from the detail section. Then add code to
the Header Section On Format event:
Me.MoveLayout = False
 
S

Simon Shutter

Duane et al,

Great tip - is there an equivalent method for putting a footer field
adjacent to the last record in the details section?

Tx
 

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