General information
Category:
Coding, syntax & commands
Just for TOP button. Looks like you have something special in thisform.showrec.
What is there?
>I am having 4 buttons on each form viz. TOP,PREVIOUS, NEXT and BOTTOM.
>I have created the following code on each buttons click event
>
>"For TOP Button" : Click Event
>----------------
>
>sele Register
>set order to tag Register
>if not bof()
> go top
>endif
>thisform.cmdPrev.Enabled = .f.
>thisform.cmdTop.Enabled = .f.
>thisform.cmdnext.Enabled = .t.
>thisform.cmdbott.Enabled = .t.
>
>if bof()
> thisform.cmdPrev.Enabled = .f.
> thisform.cmdTop.Enabled = .f.
> thisform.cmdnext.Enabled = .t.
> thisform.cmdbott.Enabled = .t.
>endif
>
>if eof()
> thisform.cmdnext.Enabled = .f.
> thisform.cmdbott.Enabled = .f.
>endif
>thisform.showrec
>
>
>-----------------
>PROBLEM: But for the First Record we have to click one more time to make it
>disabled.
>----------------
>
>"For Previous Button" : Click Event
>---------------------
>
>
>sele Register
>set order to tag Register
>if not bof()
> skip -1
>endif
>thisform.cmdbott.enabled = .t.
>thisform.cmdnext.enabled = .t.
>
>if bof()
> thisform.cmdPrev.Enabled = .f.
> thisform.cmdTop.Enabled = .f.
> thisform.cmdnext.Enabled = .t.
> thisform.cmdbott.Enabled = .t.
>endif
>
>if eof()
> thisform.cmdnext.Enabled = .f.
> thisform.cmdbott.Enabled = .f.
>endif
>thisform.showrec
>
>-------------------
>
>Note : Is the code right ?
>
>-------------------
>
>"For Next Button" : Click Event
>------------------
>
>sele Register
>set order to tag Register
>if not eof()
> skip
>endif
>thisform.cmdprev.enabled = .t.
>thisform.cmdtop.enabled = .t.
>if eof()
> thisform.cmdPrev.Enabled = .t.
> thisform.cmdTop.Enabled = .t.
> thisform.cmdnext.Enabled = .f.
> thisform.cmdbott.Enabled = .f.
>endif
>
>if bof()
> thisform.cmdPrev.Enabled = .f.
> thisform.cmdTop.Enabled = .f.
>endif
>thisform.showrec
>---------------------
>
>Note : Is the code right ?
>
>--------------------
>
>"For Bottom Button" : Click Event
>
>-------------------
>
>
>sele Register
>set order to tag Register
>if not bof()
> go bott
>endif
>thisform.cmdnext.Enabled = .f.
>thisform.cmdbott.Enabled = .f.
>thisform.cmdPrev.Enabled = .t.
>thisform.cmdTop.Enabled = .t.
>
>if bof()
> thisform.cmdPrev.Enabled = .f.
> thisform.cmdTop.Enabled = .f.
> thisform.cmdnext.Enabled = .t.
> thisform.cmdbott.Enabled = .t.
>endif
>
>if eof()
> thisform.cmdnext.Enabled = .f.
> thisform.cmdbott.Enabled = .f.
>endif
>thisform.showrec
>----------------------
>
>PROBLEM : I don't get this button disabled when I am at last record.
>--------------------
>
>
>Pl. Help
>
>
>I don't want to use any other classes if available because I have already
>used this code in all the buttons of all the forms. So pl. help me
>correcting this code.
>
>
>Thanks in Advance
>
>Ashish Patel
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only