I've got some weird behaviour that I can't figure out. In my form, I have the following code in the cmdNext navigate button:
*cmd next
IF NOT EOF()
skip
thisform.Refresh()
ENDIF
IF EOF()
=MESSAGEBOX("This is the last " + THISFORM.recordtype, MSGOKONLY + MSGEXCLAMATION, C_APPNAME)
GOTO BOTTOM
thisform.Refresh()
ENDIF
This works fine except when I'm at the end of the table. In that case, when I click cmdNext, the form appears to move past the end of the file and I get a blank record on the screen. What I should be getting is the "This is the last . . ." message.
This is the code in my form's refresh method:
*form refresh
if cu.active = .f.
thisform.txtin_date.visible = .t.
thisform.txtin_date.enabled = .f.
thisform.lblin_date.visible = .t.
else
thisform.txtin_date.visible = .f.
thisform.txtin_date.enabled = .f.
thisform.lblin_date.visible = .f.
endif
I then opened the table (191 records), positioned the record pointer on the last record (191) and from the command window typed SKIP. It actually skipped to phantom record 192 ??? (After issuing the SKIP, I typed ?recno() and got 192. What's happening here? When I type GO 192, I get "record out of range".
Anyone have any ideas on this one?
Al Williams
Anola MB, CANADA