Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2004, 06:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default DB CR Balance in Form

How can display current balance at the time of data entries in cash book.

I create cash book like this in Access form, and table link with the SQL Server 2000.

table name CASH
Invdate Desc DB CR BAL
---------------------------------------------
1/10/2004 Bal c/f 0 0 10000
2/10/2004 Sales 3000 13000
3/10/2004 Exp 2000 11000
.......
and so on...

I want that at the time of data entries in cash book current balance should also
display in the data entries form, how can do ?
only DB and CR data have to do data entries, not enter
balance, Balance should be display automaticaly, how ?

there are some procedure or event procedure on lost focus
in the Access Properties ?

Please help.

Mateen


 
Old October 9th, 2004, 08:36 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

As a caution advice do not store a total or running balance in the table. There are numerous reasons not to do this from the standpoint of data integrity. Do this in a report or form.

Try using the below as an example

To run a calculation each time you enter a new record total, you need
a "Running Balance" field to hold the data, and on the Debit/credit

AfterUpdate event you can make this calculation:

Private Sub TotalDebit_AfterUpdate()
Me.Balance = Me.Amount - Me.TotalDebit
Me.Running_Balance = Me.PrevBal + Me.Balance
End Sub


I hope you get the idea



Jaime E. Maccou
Applications Analyst
 
Old October 10th, 2004, 07:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your response.

what is amount and prevbal ?
how display (see) the balance in the report or form ?

my form have three fields,ie
db, cr and bal
I have to create one more field running_balance field in the form.
so what will be coding will use in afterupdate event in running_balance field ?

this coding will use running_balance field ?
ie

Me.Bal = Me.CR - Me.DB
Me.Running_Balance = Me.Running_balance + Me.Bal

please send the coding.
thanks for your cooperation.

regards.

Mateen



 
Old October 11th, 2004, 09:17 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Not to take you away from my original suggestion; look tat this article first.
http://support.microsoft.com/kb/210338/EN-US/

Jaime E. Maccou
Applications Analyst
 
Old October 12th, 2004, 11:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11 Pg 334 Running Balance JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 November 29th, 2007 04:07 AM
Compute Balance zone Excel VBA 2 August 17th, 2007 09:16 AM
Displaying the previous days balance in report ayamas Crystal Reports 1 June 5th, 2006 06:44 AM
CR connectivity to Oracle DB CRuser Crystal Reports 0 June 21st, 2004 01:29 AM
Which is Best For Balance tables alyeng2000 SQL Server 2000 1 March 9th, 2004 09:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.