>ThisForm.DtKeyPress = DATETIME() >ThisForm.dtMouseMove = DATETIME() >SELECT fac_mas >SET ORDER TO operator >IF m.swid = " " > thisform.txtcount.value = Recno() > thisform.txttotal.value = Reccount() > > IF (recno() == 1) > thisform.cmdback.enabled = .F. > thisform.cmdbeg.enabled = .F. > ENDIF > > IF (RECNO() == RECCOUNT()) > thisform.cmdforward.enabled = .F. > thisform.cmdend.enabled = .F. > ENDIF >ELSE > thisform.txtcount.value = Recno() > thisform.txtcount.ReadOnly = .T. > thisform.txttotal.value = Reccount() > > thisform.cmdback.enabled = .F. > thisform.cmdbeg.enabled = .F. > thisform.cmdforward.enabled = .F. > thisform.cmdend.enabled = .F. > thisform.cmdfind.Enabled = .F. >ENDIF >IF m.movebottom = "YES" > LOCATE FOR sw_id = newswid > m.movebottom = "NO" >ENDIF >thisform.refresh >O! GOD!
ThisForm.DtKeyPress = DATETIME() ThisForm.dtMouseMove = DATETIME() SELECT fac_mas SET ORDER TO operator GO TOP thisform.txtcount.value = Recno() thisform.txttotal.value = Reccount() IF m.swid = " " *** We are at the top, remember GO TOP command :-) thisform.cmdback.enabled = .F. thisform.cmdbeg.enabled = .F. IF (RECNO() == RECCOUNT()) *** That is just in case you have only one record in the table thisform.cmdforward.enabled = .F. thisform.cmdend.enabled = .F. ENDIF ELSE thisform.txtcount.ReadOnly = .T. thisform.txttotal.value = Reccount() thisform.cmdback.enabled = .F. thisform.cmdbeg.enabled = .F. thisform.cmdforward.enabled = .F. thisform.cmdend.enabled = .F. thisform.cmdfind.Enabled = .F. ENDIF IF m.movebottom = "YES" LOCATE FOR sw_id = newswid m.movebottom = "NO" ENDIF thisform.refreshThen in "next" button do:
SKIP IN fac_mas IF EOF("fac_mas") SKIP -1 IN fac_mas *** disable all forward buttons here ENDIFIn "Previous" button do:
SKIP -1 IN fac_mas IF BOF("fac_mas") SKIP IN fac_mas *** disable all backwards buttons here ENDIFIn "go to last" button:
GO BOTTOM *** disable all forward buttons hereIn "go to first" button:
LOCATE *** disable all backwards buttons hereI hate wizards :-)