Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One Cursor, Two Forms
Message
From
19/07/1999 21:14:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00243391
Message ID:
00243394
Views:
28
>Greetings:)
>I've got a form with a grid on it...I have 4 boxes at the top that the user can fill in and then hit the search button and it compiles a SQL statement into an initial cursor with all the fields I want to use, then it pulls only 4 fields into a secondary cursor that is used by the grid, and ORDER BY the PartNo at first, then they can hit the header of the column they want to have the list sorted by and the second SQL statement is run again only this time with the ORDER BY the field for that column.
>Now here's the tricky part; I want to enable my users to be able to double click on a row and then a details form would show up with the details about that particular part number(basically all the fields in the first SQL statement); but I want it to use the ORDER BY field from the second SQL statement. Also, I've got a navigation bar on the details box because it'd be nice for them to scroll through the results...
>I've got this all working except for the details box...I can't seem to get it to use the correct cursor, nor can I get it to go to the correct record... or something, at this point I'm not sure what to try...so ANY suggestions, like a better way to do this, would be GREATLY appreciated:)

When you dbl-click on grid row, you actually move pointer exactly on this recordsource (cursor) record. If you want to take data not only from this record, but from other tables/cursor then your grid cursor should carry primary key from the underlying table(s).
Copule more considerations, not required generally. There is no necessity to run SQL-Select twice to get identical cursors, you may just
USE (dbf()) AGAIN ALIAS newcursor
to reopen it in another work area and then use both independently. Also, you may index a cursor, i.e. you don't need to re-run SELECT-SQL with different ORDER clauses. Create your cursor once, and index it with few tags. One more thing, when you create cursors (SELECT_SQL) for subsequent data manipulation, you will be safer if use NOFILTER clause.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform