Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using eof()
Message
From
06/12/2005 10:01:00
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01075287
Message ID:
01075300
Views:
17
>>I have an edit box on a form with several controls. One is to move to the next record(NEXT) and the other is to move to the previous record (PREVIOUS). The code in the next button is as follows:
>>
>>
>>Select cursor
>>
>>If  Eof()
>>	Wait Window "Last Note" Nowait
>>Else
>>	Skip
>>Endif
>>Thisform.Refresh
>>
>>
>>
>>
>>When it get to the eof()it will show the last record and the next time you click the NEXT button the edit box is grayed out. Evidently on the phantom record.
>>
>>Going the other way (previous)and using the same code but using BOF() it stops at the first record no matter how many times you click the PREVIOUS button.
>>


>>How do I get around the blank(gray) edit box. I know it must be something simple but I need to demo this tomorrow and would like to avoid the gray box.
>>
>>
>>Thanks
>>Gaylen
>
>Gaylen
>
>My "prev" button has the following code,. .cmdNext and .cmdLast are the "next" and "last" buttons.
>HTH
>
>Terry
>
>
>If not BOF()
>    Skip -1
>    If BOF()
>        Go TOP
>        This.Enabled                 = .F.
>        This.Parent.cmdFirst.Enabled = .F.
>    Endif
>    With This.Parent
>      .cmdNext.Enabled		 = .T.
>      .cmdLast.Enabled		 = .T.
>    EndWith
>EndIf not BOF()
>
Terry

What is the code in the cmdNext button? The previous button works fine.

I tried using go top in my NEXT code and I still get the grayed out edit box.
Thanks
Gaylen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform