Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Not following Record Pointer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Grid Not following Record Pointer
Divers
Thread ID:
00056671
Message ID:
00056671
Vues:
71
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
Répondre
Fil
Voir

Click here to load this message in the networking platform