Here is what I did.
1. I created a query with this SQL
Code:
SELECT [b]DateSerial(Year([Date]),Month([Date])+1,0)[/b] AS myDate, Sum(tblBalance.Deposits) AS SumOfDeposits, Sum(tblBalance.Contributions) AS SumOfContributions
FROM tblBalance
GROUP BY DateSerial(Year([Date]),Month([Date]),1)
HAVING (((DateSerial(Year([Date]),Month([Date]),1))>=[Forms]![frmParameter]![Text0]))
ORDER BY DateSerial(Year([Date]),Month([Date]),1);
The DateSerial() function just gives me the last day of the month so that all the totals are grouped on each month. The only issue might be that my first entry in the table was for Dec 31, 2005 for $30000. I had to have a starting point, and that was it for me. The rest of the entry were just the same as your spreadsheet example.
2. Then I created this query.
Code:
SELECT Sum(tblBalance.Deposits) AS SumOfDeposits
FROM tblBalance
WHERE (((DateSerial(Year([Date]),Month([Date])+1,0))<[Forms]![frmParameter]![Text0]));
The first query is a parameter query that my report is built on. The second query is a paramter query that gives me a balance to start with.
3. I have a form, frmParameter, that has 2 textboxes on it. One for entering a start date to filter the first query, and one for passing the value from the second query to my global variable. I have a button that uses DLookup() to get the value from my second query, pass it to my global variable and open the report. This is the click event
Code:
Private Sub Command2_Click()
Me.Text3 = DLookup("SumOfDeposits", "qryBalance2")
DoCmd.OpenReport "rptBalance", acViewPreview
gdblRunSum = Me.Text3
End Sub
4. On the report, which has qryBalance as the Record Source, I have a textbox to grab the global variable in the Page Header(as I described above). I have a Date header, with the date field in it, that groups the values into months.
I have three textboxes in a SumOfDeposits Header. Two,SumOfDeposits, and SumOfContributions have their Running Sum properties set to Over All, and the third is just like Text19 that I described above, where you set the Control source to =1, the running sum property to over all, and the visible to No.
4. Lastly, I have a SumOfDeposits Footer. I have one textbox in that with the control source set to
=IIf([Text19]=1,[BalanceValue]+[SumOfDeposits]-[SumOfContributions],[SumOfDeposits]-[SumOfContributions])
with the Running Sum property set to Over All.
That give me a report that groups by month, give me a total Deposits for the Month, total Contributions for the Month, and a Footer balance that shows a running balance.
Give it a go and post back with specific problems.
Paul