Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Amount disappears when entering in a GRID
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Amount disappears when entering in a GRID
Miscellaneous
Thread ID:
00209170
Message ID:
00209170
Views:
35
There is a keypress and valid event in the amount cloumn of this grid. In the keypress event, I test for the "enter" key, to move the pointer down one row. The valid event sums up the preceding rows to display a running total in a textbox.
When pressing the enter key on the last row the pointer goes to the next row but the amount disappears. What?
If i can give anymore info to help solve this please let me know,Thanks
**
It looks like this:
KeyPress Event:
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL lnRecNo
SET DELETED OFF
lnRecNo=RECNO()
IF RECCOUNT()=lnRecNo
IF nKeyCode=13 OR nKeyCode=24
APPEND BLANK
KEYBOARD '{DNARROW}'
ENDIF
ENDIF
SET DELETED ON
**
Valid Event:
LOCAL lnTmpTotal,lnToCnt
lnTemp=RECNO()
COUNT FOR !DELETED() TO lnTotCnt
lnTmpTotal=0
GO TOP
DO WHILE NOT EOF()
IF !DELETED() then
lnTmpTotal=lnTmpTotal+amt
ENDIF
SKIP
ENDDO
GOTO lnTemp
gnAllTotal=lnTmpTotal
THISFORM.txtEnterTotal.VALUE=gnAllTotal
THISFORM.txtTotRecCnt.VALUE=lnTotCnt
This.refresh
Extreme Programming = Plan -> Design -> Code -> Test
Reply
Map
View

Click here to load this message in the networking platform