I have a report which shows the OrderID,PIN#, DateCreated,etc...
The report is grouped by PIN#. But I only need the report to show 3 most recent records for each grouped PIN#(based on DateCreated).
How am I going to do it?
Please advise
I would:
1) add a text box to the detail section of the report
Name: txtCount
Control Source: =1
Running Sum: Over Group
2) add code to the On Format event of the detail section
Cancel = Me.txtCount > 3
This assumes the correct sort order in your report.
Duane
MS Access MVP
Find out how to get great answers faq219-2884.
Could you be a bit more specific than "still not working the way I expected"?
I took the time to carefully explain a method that has always worked for me based on your original question. The least you could do is suggest what isn't working and what you tried.
Duane
MS Access MVP
Find out how to get great answers faq219-2884.
Sorry! Here's what I did by following your instructions:
I put a text box(txtCount) in the detail section of the report and set it Control Source to 1 and Running Sum to Over Group.
in the report's event On_Format, I wrote the code:
cancel=me.txtCount>3
When I ran the report, a message box pops up saying Enter Parameter. Just to ignore it, I click OK and the report will show all the records. I only need report to show 3 most recent dates records for each grouped PIN#
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.