>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()
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.