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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

End of Month Balance Expression within a Text Box

Status
Not open for further replies.

CoolFactor

Technical User
Dec 14, 2006
110
US
I have two fields with following titles Deposits and Contributions that both store positive amounts. Initially there was an amount that carried over from the previous year. What I need is the differences from the Deposits and Contributions fields against the amount that was carried over from last year. I've built a report with just showing the deposits and contributions of both these fields grouped by Month. In the design view of date field of the query that I built for this report, I included an expression so I can have parameterized date range report. I want to include a text box in a month header that I created that includes differences from the Deposits and Contributions based on the initial amount carried over from the previous year on a monthly basis. Any ideas will be greatly appreciated.

Let me give you a better Idea of what I am looking for though. I created this excel spreadsheet to give you exactly what I want to accomplish in Access.
Example:
12-31-05 Balance Forwarded: $30,000
Date Deposits Contributions
1-1-06 $2000 $1000
1-15-06 $1000 $1000
January Balance: $31,000
Balance Forwarded: $31,000
Date Deposits Contributions
2-1-06 $5000 $2000
2-23-06 $4000 $1000
2-28-06 $3000 $1000
February Balance: $39,000
Balance Forwarded: $39,000
and it continues for each month

As you can see I'm subtracting the Contributions from the
Balance Forwarded and adding the Deposits to it in order to get the Ending Balance for that month. Then that balance is carried over to the next month.

I want to do this exact same thing in an Access report. What I did in Access thus far is made a table with the Date , Deposits, Contributions and other related fields. The initial deposit that I started with in this Access table was
the $30,000 that was forwarded from 12-31-05 Balance Forwarded. I created a parameterized date report grouped by month. When I enter the parameters for the Start Date and End Date for October for example what happens is the text box I created in the Month Header to account for this end of the month balance is just taking the difference between the Deposits and Contributions instead of the initial deposit of $30,000 and the rest of the previous deposits and contributions.

An example of what is happening is this:
Lets just take the excel spreadsheet I used as an example:
I'll pick the month February:
What's happening in the Access Report is that it is giving me the difference between Deposits and Contributions which would give you the dollar amount of $8000. What I need is dollar amount of $39,000 which is the correct ending February Balance.

In this Report I created parameterized query that would give me the deposits and contributions for that month or for several months depending on the parameters that I enter. The text that I created the month header of the report would contain the expression that would produce the calculation that I am looking for.
 
It seems to me that you just about have it on your own!

As you state, you can allready get the current period "delta" of deposits to contributions so getting the TOTAL value should be a simple change to your formula that calculates from the "absolute" beginning (i.e. if you started recordkeeping back in 1906 to the current period.)

So your formula for calculating the current net (in the text box) would be changed slightly to set the beginning date at #1/1/1906# and the period date end. After all, the rollover or starting period balance is nothing more than the sum of the contributions and deposits!

Make sense or am I completely missing the point?

Lt
 
It makes sense but would it be possible be see what you would put in the control source of the text box as an example. Thank you for you help as well.
 
Actually,
I re-read what you were trying to do so I put the following in a text box in the Month FOOTER not header. That way it shows more appropriately what carry forward balance is.


=Sum([deposit])-Sum([contribution])

And then select Running Sum OverAll.

You should end up with something that looks like

December
Deposits Contributions
30000 0
GroupFooter BalForward 30,000.00
January
Date Deposits Contributions
1-1-06 $2000 $1000
1-15-06 $1000 $1000
January Balance: $31,000
GroupFooter Balance Forwarded: $31,000

February
Date Deposits Contributions
2-1-06 $5000 $2000
2-23-06 $4000 $1000
2-28-06 $3000 $1000
February Balance: $39,000
GroupFooter Balance Forwarded: $39,000


Does this work for you or am I still missing the point?

LT




 
I appreciate all your help. I think you are on to something that I probably can't see. Are you combining what you wrote first with what you wrote second. If so what does that look like in the Control Source of the text box.

The reason I ask is because if I do what you recommended second, I still continue to get the incorrect differences. The way I built this report is based on a query that shows me multiple relevant fields like date, last name, type of fund, and then deposits and contributions fields. In the query for this report under the Date field in the criteria space I entered Between [Enter a Start Date] And [Enter an End Date]. I did this so when I click on my report and I just wanted to look at the month of October 2006, it would bring up that month showing me the relevant information. I also grouped this report by month.

As you know I created the text box in the footer and in the control source and I typed what you told me to type but I still get the incorrect differences.

I don't know if it has to do with the query I built or what. Once again thank you for helping me.
 
If you want to send me a sample of your code at ltleary2000@yahoo.com I'd be glad to take a look at it.

LT
 
LTLeary,

I sent you an email but it bounced back an error message stating that you didn't have a yahoo account.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top