How to count records on each page including the count of all previous pages (1 Viewer)

daud

New member
Local time
Today, 15:12
Joined
May 28, 2009
Messages
14
Dear All, may you live long.
Example:-
I have 20 records on page#1 and 21 records on page#2. On page#2, i want to show count of total records that is = 41. Similarly I have 9 records on page#3 and on the bottom of page#3, I wanted to show count result as 50.
Regards and best whsihes
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:12
Joined
May 7, 2009
Messages
19,245
is it solved?
anyway see the report in Print Preview (will only work on this view).
 

Attachments

  • CountRecordsInReport.accdb
    672 KB · Views: 70

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 19, 2002
Messages
43,288
@arnelgp Check your counts again. They are not correct.

It looks like there has been some change to the way reports work. I tried to fix the problem by using the Retreat event but the Retreat event no longer seems to fire. so I moved the arithmetic to the Print event and that seems to resolve the problem since it doesn't run until Access is actually ready to print the line AND knows it has room to do so.

I added a bunch of displays in an effort to see if I could determine why the Retreat event was not firing but never resolved that so I created a second version of the report and left the displays it.

You can run both versions and you will see that the counts are correct in the second version.
 

Attachments

  • CountRecordsInReportPat.accdb
    580 KB · Views: 73

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:12
Joined
May 7, 2009
Messages
19,245
i introduced a Hidden textbox to count cummulative.
and use array now.
 

Attachments

  • CountRecordsInReport.accdb
    528 KB · Views: 79

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 19, 2002
Messages
43,288
Anything but use my suggestion:ROFLMAO::ROFLMAO::ROFLMAO::ROFLMAO::ROFLMAO: Please, don't even say thank you for pointing out the problem but you're welcome anyway.
 

daud

New member
Local time
Today, 15:12
Joined
May 28, 2009
Messages
14
i introduced a Hidden textbox to count cummulative.
and use array now.
please what did you do with the report, where you added any event builder. and how can I apply to my real database
Regards and best wishes
You and arnelgp have always helped
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 19, 2002
Messages
43,288
@daud I guess you didn't see this:

so I moved the arithmetic to the Print event and that seems to resolve the problem since it doesn't run until Access is actually ready to print the line AND knows it has room to do so.

Just comment out my debug.print statements from the second version of the report.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:12
Joined
May 7, 2009
Messages
19,245
how can I apply to my real database
you upload your db and i will apply it.
or pm me and i will tell you how you can upload the db privately.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 19, 2002
Messages
43,288
@daud If you understood the original code, just move it to the correct event as I showed in #3. Just comment out the debug.print statements. They are only there to confirm that the counts are correct at each stage.
 

Users who are viewing this thread

Top Bottom