Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
External orders
Message
From
12/01/2003 17:06:49
 
 
To
12/01/2003 16:29:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00740835
Message ID:
00740844
Views:
14
If you are using VFP7 or above you can use Database events to handle this automatically like this
PROCEDURE dbc_BeforeOpenTable
LPARAMETERS cTableName

if lower(cTableName) == 'customer' and not used('dealer')
  use dealer again in 0
endif
Glenn

>Hi
>
>I have a customer table which has an optional link to a dealer table. I want to be able to order the customer table (in a grid) by the dealer name.
>
>I can create an index on the customer with an expression of
>
>IIF(INDEXSEEK(d_key,.T.,"DEALER","D_KEY"),Dealer.name,SPACE(40))
>
>
>but then I have to have the dealer table open every time I want to use the customer table (including in the form designer) While I can do this, it seems messy.
>
>The user needs to be able to select which order they want, most of which are on the customer table. I can create an external index each time I need to use the index but this also seems a bit messy.
>
>Is there a better way???
>
>Regards
>Geoff Scott
Previous
Reply
Map
View

Click here to load this message in the networking platform