Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whattagrid!!!
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01159650
Message ID:
01159725
Views:
17
>Hello Gurus!!
>
>Today's question...................
>
>I have a form with a GRID on it. This grid is displaying data from 3 tables (Rx, Drug and Doctor) that are linked together this way.....
>
>Rx -> Drug through Rx.drug_id = Drug.drug_id
>
>and
>
>Rx -> Doctor through Rx.doctor_id = Doctor.doctor_id
>
>simple enough, yes?
>
>We have a button on the screen for CHANGE GRID ORDER. If pressed, the order of the grid changes.... based on the index chosen when you click the button.
>
>Presently there are only 2 indexes to switch among....
>1) Date order
>2) Descendig Rx number order.
>
>These indices are based on fields that are exclusively in the Rx table, which is the SELECTED table of the grid (the other 2 are linked and some fields displayed).
>
>NOW... we would like to be able to add a 3rd choice to the ordering displayed (and add a 3rd index to choose from). Here is the rub.....
>
>The 3rd index is on DRUG name... which is in the linked table DRUG. I can't create an index based on 2 tables to get at the Drug name..... so what options are available?
>
>Remove the 3 tables from the grid, and replace with a CURSOR of the 3 tables, so as to get at the field DRUG_NAME in DRUG? Or what?
>
>Thanks in advance!!!
>Tommy

I think you answered your question. If grid for display only, I would use cursor created in the load with CREATE CURSOR command and populated on the fly with the result of select. You may add as many indexes you want.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform