thisform.Grid1.RecordSource = NULL SELECT * FROM TABLE1 where mac1=thisform.text1.value INTO CURSOR grdCursor thisform.Grid1.RecordSource = "grdCursor" thisform.Grid1.Refresh()
&&& this code under keypres event this.text8.value if nkeycode=13 old_alias = ALIAS() flag_use = .f. IF .NOT. USED("Table1") SELECT 0 USE table1 flag_use = .t. ENDIF m.dat=thisform.text2.value m.plan=thisform.text3.value m.true=thisform.text4.value m.hot=thisform.text5.value m.balance=thisform.text6.value m.mint=thisform.text7.value m.other=thisform.text8.value m.rem=thisform.text9.value m.mac1=thisform.text1.value append blank gather memvar SUM CTOT(plan) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(plan,2))*3600 + ; VAL(SUBSTR(plan,4,2))*60 + ; VAL(RIGHT(plan,2)) TO lnSec THISFORM.TEXT10.VALUE= PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") * lnCost=thisform.text3.value *THISFORM.TEXT10.VALUE = ROUND(lnSec/3600*lnCost,2) SUM CTOT(true) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(true,2))*3600 + ; VAL(SUBSTR(true,4,2))*60 + ; VAL(RIGHT(true,2)) TO lnSec THISFORM.TEXT11.VALUE= PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.refresh IF flag_use USE IN table1 ENDIF IF .NOT. EMPTY(old_alias) SELECT (old_alias) ENDIF endifthanks.
>thisform.Grid1.RecordSource = NULL >SELECT MAX(DAT) FROM TABLE1 where mac1=thisform.text1.value INTO CURSOR grdCursor >thisform.Grid1.RecordSource = "grdCursor" >thisform.Grid1.Refresh() >