If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
row number: specifying the group when using "over group"
I'm having a problem with row numbers in a report with three
groupings. The exact subject matter is a bit arcane, so as an example I'll use taxi cabs. My question is simple: how do I get the desired result (listed third below)? In other words, how do I specify the group when asking for a running sum "Over Group"? (The hypothetical data assumes as fixed-width font.) Thank you, Alec -------------------- OVER ALL -------------------- Row | Day: Tuesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13567 13580 2 13580 13585 Total: 18 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9721 9740 4 9740 9753 Total: 22 Row | Day: Wednesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 5 13585 13600 6 13600 13611 Total: 26 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 7 9753 9767 8 9767 9774 Total: 19 -------------------- OVER GROUP -------------------- Row | Day: Tuesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13567 13580 2 13580 13585 Total: 18 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 1 9721 9740 2 9740 9753 Total: 22 Row | Day: Wednesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13585 13600 2 13600 13611 Total: 26 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 1 9753 9767 2 9767 9774 Total: 19 -------------------- DESIRED -------------------- Row | Day: Tuesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13567 13580 2 13580 13585 Total: 18 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9721 9740 4 9740 9753 Total: 22 Row | Day: Wednesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13585 13600 2 13600 13611 Total: 26 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9753 9767 4 9767 9774 Total: 19 |
#2
|
|||
|
|||
row number: specifying the group when using "over group"
Coltrane04 wrote:
I'm having a problem with row numbers in a report with three groupings. The exact subject matter is a bit arcane, so as an example I'll use taxi cabs. My question is simple: how do I get the desired result (listed third below)? In other words, how do I specify the group when asking for a running sum "Over Group"? -------------------- DESIRED -------------------- Row | Day: Tuesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13567 13580 2 13580 13585 Total: 18 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9721 9740 4 9740 9753 Total: 22 Row | Day: Wednesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13585 13600 2 13600 13611 Total: 26 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9753 9767 4 9767 9774 Total: 19 Use two running sum text boxes. Add another one to the driver group footer section. Then the detail -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
row number: specifying the group when using "over group"
Marshall Barton wrote:
Coltrane04 wrote: I'm having a problem with row numbers in a report with three groupings. The exact subject matter is a bit arcane, so as an example I'll use taxi cabs. My question is simple: how do I get the desired result (listed third below)? In other words, how do I specify the group when asking for a running sum "Over Group"? -------------------- DESIRED -------------------- Row | Day: Tuesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13567 13580 2 13580 13585 Total: 18 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9721 9740 4 9740 9753 Total: 22 Row | Day: Wednesday ------------ Driver: Alice ------------- Odometer Start | Odometer Stop --------------------------------- 1 13585 13600 2 13600 13611 Total: 26 Driver: Bob ------------- Odometer Start | Odometer Stop --------------------------------- 3 9753 9767 4 9767 9774 Total: 19 Whoops. Let's try that again. Use two running sum text boxes. Assuming the detail section running sum text box is named txtLine. Add an unbound text box (named txtGrpZ) to the day group header section. Add a line of code to the day group header section's Format event to initialize the text box's value: txtGrpZ = 0 Now, add a text box (named txtGrpLine) to the driver group footer section. Set its RunningSum property to Over Group and its expression to: =txtLine Add a line of code to the driver group footer section's Format event: txtGrpZ = txtGrpLine Finally, add another text box to the detail section. Use the expression: =txtGrpZ + txtLine -- Marsh MVP [MS Access] |
#4
|
|||
|
|||
row number: specifying the group when using "over group"
What an ugly hack! Given my current frustration level, I'm just happy
that it works. Thank you. -- Alec Whoops. Let's try that again. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|