Hi Marcia,
Thanks for replying,
Yes, what I'm doing here is making a view as a grid's recordsource, and I wrote a code like this,
PROCEDURE Grid1.Init
LOCAL lcname
lcname=THIS.PARENT.NAME
WITH THIS
.RECORDSOURCE='accounting'
.RECORDSOURCETYPE=1
.COLUMN1.CONTROLSOURCE='accounting.cat'
.COLUMN2.CONTROLSOURCE='accounting.date'
.COLUMN3.CONTROLSOURCE='accounting.payee'
.COLUMN4.CONTROLSOURCE='accounting.subout'
.COLUMN5.CONTROLSOURCE='accounting.subin'
.COLUMN6.CONTROLSOURCE='THISFORM.&lcname..GRID1.BALANCE()'
ENDWITH
ENDPROC
PROCEDURE Grid1.Balance
SELECT Accounting
lnBalance = subin - subout
SKIP -1
IF !BOF()
lnBalance = lnBalance + balance
SKIP 1
ELSE
GO TOP
ENDIF
IF !lnBalance = balance
REPLACE balance WITH lnBalance
ENDIF
RETURN lnBalance
THIS.Column4.Text1.Valid()
THIS.Column5.Text1.Valid()
ENDPROC
PROCEDURE Text1.Valid (For Col4 & Col5)
IF !balance = THIS.Parent.Parent.Balance()
THIS.Parent.Parent.Column6.Refresh()
ENDIF
ENDPROC
Accounting SQL-select
CREATE SQL VIEW AS Select Cash_account.cat, Cash_account.date, Cash_account.payee, Cash_account.subout, Cash_account.subin,0000000000.00 AS balance ;
FROM Main!Cash_account ORDER by Cash_account.Date
Hope you can gimme any suggestion,
TIA :-)
Senna Dwipayana
Being good is better
Being better is a bless