Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command buttons
Message
From
22/08/1999 00:02:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00256191
Message ID:
00256367
Views:
23
>i'm not fully familiar with vfp yet. can anyone tell me how to make my top, next, previous and last button in my form work?

Susan,

Actually it's pretty simple. For this example, "MyCursor" refers to the table you want to navigate through.

*- cmdMoveFirst.Click() (Click event of the Move First (Top) Button)
SELECT MyCursor
GO TOP
THIS.PARENT.REFRESH()

*- cmdMovePrevious.Click() (Click event of the Move Previous Button)
SELECT MyCursor
IF NOT BOF()
SKIP -1
IF BOF()
GO TOP
ENDIF
ELSE
GO TOP
ENDIF
THIS.PARENT.REFRESH()

*- cmdMoveNext.Click() (Click event of the Move Next Button)
SELECT MyCursor
IF NOT EOF()
SKIP
IF EOF()
GO BOTTOM
ENDIF
ELSE
GO BOTTOM
ENDIF
THIS.PARENT.REFRESH()

*- cmdMoveLast.Click() (Click event of the Move Last Button)
SELECT MyCursor
GO BOTTOM
THIS.PARENT.REFRESH()

This is a pretty elementary approach. In my apps, I use parameterized views of the tables. The view will only contain one record at a time. To allow my users to navigate, I create a cursor with all the rows, but only a few columns. This same cursor also drives the search engine I use. My buttons are a bit more generic, and read parameters from the form to know which cursor to select, among other things.

If there's any other help, or clarification I can provide, don't hesitate to ask.
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Reply
Map
View

Click here to load this message in the networking platform