Report Question

  • Thread starter Thread starter 627dmp
  • Start date Start date
6

627dmp

I'm trying to create a Report that would take the first 5 records and assign
them a #1 in a field called "Squad" and then assign a #2 to the next 5
records and a #3 to the next 5 records, and so on down the list.......what
would be the easiest way to go about this?
 
Add a textbox to the report
-- set its source to
=1
-- set its running sum to overall
-- name it mylinecount
-- set its visible property to No

Add another textbox to the report
-- set its source to
=((MyLineCount -1)\5) + 1

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
"first 5 records" implies that they are in some order. How will Access
"know" what order?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I'm creating a database that would keep track of scores for a highschool trap
shooting league. First they shoot 50 rounds and based on what they shot out
of the 50 rounds, something called yardage is figured which is half of the
50, so if they shot 48, their yardage would be 24, and then they are put in
squads based on their yardage, there is 5 shooters per squad, so I've been
actually trying a couple of different ways to run this report, first I
thought the text box could add them for me, but I'm not sure that is the best
way of doing it, now I'm wondering if DLookup might not be the best way, I've
created a table that has squads 1 thru 100, so each squad has 5 lines,
expample: sq 1 pos 1
sq 1 pos 2
sq 1 pos 3
sq 1 pos 4
sq 1 pos 5
sq 2 pos 1
sq 2 pos 2
and so on..... if DLookup is the best option, can you give me an example of
how to make it work........Thanks
 
Did you try my proposed solution? If you did and it failed can you explain
how it failed?

I am curious as unless I messed up, that should have worked in a report to
give you the numbers 1 to 5 on a repeating basis. And reexamining what I
posted I think I did mess up.

SquadNumber Control
Add another textbox to the report
-- set its source to
=((MyLineCount -1)\5) + 1

Position Control
Add another textbox to the report
-- set its source to
=((MyLineCount -1) Mod 5 ) + 1

That should give you sequences like the following in the report.
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
....

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top