Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a Value to Next Group

Status
Not open for further replies.

sjpistolesi

Programmer
Jun 6, 2002
71
US
ACCESS 2000 Report ---- Think I'm getting old ... just cannot wrap my brain around this one.

Slightly different challenge. Reporting monthly transactions with previous month's totals as a starting point and summing each month's transactions is working OK .... but there are months without transactions. So ....

If an Active Group is greater than 2 in my incremental sequencing, I wish to pass its Group Total Sum to the Next [active month's] Group as that Next [active month's] Group's starting Balance in the Group Header.

I do have a [non-visible] counter in the Group Header which I use to determine which incremented Group is active (Adding a starting total in the report's Header to the first Group iterations' columns.) But, I am confused as to how to then take Group 1's Total and passing it to the next Group.

I tried placing the old SUM total into a report variable and then apply it to the next Group's starting balance. But I'm getting errors, e.g., "mismatch type" or trying a direct assignment to the next groups' start balance, the error that I cannot directly assign a value to a Report TextBox.

Odd sequencing logic I know, but there could be interrupts in the Groups wherein transactions did not occur (several months in fact). So wish to in essence skip the inactive months and carry forward to the next active month and so forth.


Any thoughts on passing forward the old total to the next group's starting balance in a report??

Thanks,
Sandy
 
Instead of depending on Access Sumtotal, why don't you have a variable of yourown which has the sum of values
Here is how I managed to have Pagetotals in the next page. The same logic should work


Private Sub Detail2_Print(Cancel As Integer, PrintCount As Integer)
PgTot = PgTot + Val: PgHead = PgTot
End Sub

Private Sub GroupFooter0_Print(Cancel As Integer, PrintCount As Integer)
PgTot = 0 'Placed here since Group_Format is called immediately after the last detail line.
End Sub

Best of luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top