Still trying to count unique records...

Kila

Registered User.
Local time
Yesterday, 20:36
Joined
Mar 5, 2003
Messages
275
Regarding my previous post...
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=44309

I have managed to get the thing to count by entering a calculated box named RecordCount(ControlSource=1, Running Sum Over All) in the group header that shows a total after the last record. However, the report can be 200 pages long. I would like the sum to appear in the report header. I entered another box in the header referencing the RecordCount field, but it comes up 1. If I put it in the report footer, it comes up correctly, but even if I make the header field reference the footer field, it STILL gives 1. This does not seem like it should be so complicated. Can someone please assist? I'm sure I'm missing something minor. Thanks for your help!
 
kila,

I don't know if what you want is possible.

When your report runs (Access 97), this happens:

Header Format
Header Print

Detail 1 Format
Detail 1 Print
.
.
.
Detail n Format
Detail n Print

Detail N+1 Format ' Won't print on this page

Footer Format
Footer Print

This repeats for every page ... When your header prints, the
report hasn't even seen the first detail line.

I think the behaviour is different in A2000.

I hope someone can suggest some way that it will work.

Wayne
 
I'm pretty sure it's the same in A2K too.
 
Kevin & Kila,

I just checked out A2000 and it is different:

Header Format
Detail Format
Footer Format
.
.
.
Header Format
Detail Format
Footer Format
.
.
.
Header Print
Detail Format
Detail Print
Footer Print


It traverses the entire report before it prints the first
header.

So there is hope in A2000.

Wayne
 
Well as far as showing the running sum Total in the rpt header, it's still the same in A2K as it is in A97, i.e it shows '1'
 
Kevin is right. It still shows 1. I Assumed what it was doing (writing the header first) and tried to cheat & fake it out by telling the header to look at a box in the footer (that looked at the detail), hoping that it would have to go thru everything else before sending the info back to the header, but no luck. Thanks for checking.
 
K & K,

I don't know, the only time I have had to do
something like this in a report;

The contents of the Header was dependent upon
what was in the detail records of the report.

Not a summation, but in my experience, the
content of the Header had nothing to do with
what was in the body of the report.

In A2000, I'll be allright.

cheers,
Wayne
 
K & K,

It can be done ... (Access 2000, not A97)

Put an unbound textbox (TextBoxHeader) in the Report or Page
Header

Put an unbound textbox (TextBoxCounter) in the detail section.
Control Source = 1
Running sum over all

In the OnFormat event for the Report Footer:

Me.TextBoxHeader = Me.TextBoxCounter

Wayne
 
Thank you. I tried this, but now the computer says it can't find a Macro called Me. Are you also using a Macro?
 
Nice on Wayne :)

Works fine.

Kila, just remove the 'Me.', will still work
 

Users who are viewing this thread

Back
Top Bottom