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

Accounting Form 1

Status
Not open for further replies.

smicro

MIS
Joined
Dec 26, 2002
Messages
281
Location
US
A little or alot :-) stuck on this one. I have a form in which users can enter data for accounting. Users can enter debits and credits and based on what they enter I would like to keep a count of total debits and credits for the current record and also total debits/credits for all records. I have two text boxes linked to fields debits and credits. I have two other text boxes(Total Debits and Total Credits) on the form in which the control source is set to =Sum([Debit]) and =Sum([Credit]) to get me the total debits and total credits for the current record. The problem I'm having is that Total Debits and Total Credits fields for the current record won't update unless I go to the next record. So let's say I have two debits that equal 30 and I add another for 3. Until I go to the next record total debits is still showing 30 not 33. I was thinking of adding code maybe in the on current property of the form, something like TotalDebit.Value = Sum([Debit]) but that gave me a "Sum" error. I think I read something in here that SUM will not work in VBA( I could be wrong though). My other question is on the same form there is a total loan amount which I would like to keep the same on all records.(All records will have the same loan amount) However I would like to give the user the option to change the default value to a different loan amount but when that loan amount is changed I would like it to be changed for all records. It should be consistent thorughout as only 1 loan will exist for many users. Any help would be greatly appreciated, thanks!
 
How are ya smicro . . . . .

In the [blue]AfterUpdate[/blue] event of your Debit & Credit fields [blue]Me.ReCalc[/blue] should do the trick . . .

Calvin.gif
See Ya! . . . . . .
 
Hi Ace,

Thank you that worked! Thank you very much for your knowledge!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top