Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is in use by another user
Message
From
05/12/1998 12:30:23
Senna Dwipayana
Indo Rebel Apparel Cv
Bandung, Indonesia
 
 
To
05/12/1998 11:23:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164389
Message ID:
00164469
Views:
20
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform