Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Not following Record Pointer
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Grid Not following Record Pointer
Miscellaneous
Thread ID:
00056671
Message ID:
00056671
Views:
66
My whole code for the method. The messagebox at the end shows that the activerow is always one less than the recno. Any reason you can think of?

As for the problem of 'record is out of range', it was not happening anymore after I changed THISGRID.REFRESH to THISFORM.REFRESH.

#DEFINE THISGRID THIS.PARENT.PARENT

LOCAL nWorkArea, cRoll_no, nRoll_no, nRecNo, nCurRow, nCurCol, nLastRecNo

IF LASTKEY()!=13 OR MDOWN()
RETURN .T.
ENDIF

SELECT (THISGRID.RECORDSOURCE)
cRoll_no = ''
nRoll_no = 0

nRecNo = RECNO()
nCurRow = THISGRID.ACTIVEROW
nCurCol = THISGRID.ACTIVECOLUMN
GO BOTTOM
cRoll_no = THISGRID.COLUMNS(1).text1.VALUE
nLastRecNo = RECNO()
GO (nRecNo)

IF nRecNo <> nLastRecNo
SKIP
nRecNo = RECNO()
THISFORM.REFRESH()
ELSE
nRoll_no = VAL( RIGHT( ALLTRIM(cRoll_no), RAT('/',ALLTRIM(cRoll_no))-1) )+1
cRoll_no = LEFT(cRoll_no,RAT('/',cRoll_no)) + PADL(nRoll_no,4,'0')
APPEND BLANK
REPLACE pagr_key WITH pa_grade.pagr_key, roll_no WITH cRoll_no
nWorkArea=SELECT()
nRecNo = RECNO()
THISFORM.REFRESH()
SELECT (nWorkArea)
GO (nRecNo)
ENDIF

MESSAGEBOX(STR(nRecNo)+':'+STR(THISGRID.ACTIVEROW))
RETURN
Reply
Map
View

Click here to load this message in the networking platform