>assuming that cust_id in the SET RELATION command refers to
>ORDERS.cust_id, how does VFP know what field from the parent table
>to use in the relation ? does the parent table field HAVE to
>have exactly the same name as the child relation field (or index) ?
>if the parent field name is "customer_id" and the child field (or index?)
>name is "cust_id" ... how would i write the SET RELATION command ?
>if for some reason i couldn't rename the field, would i have to
>copy the parent table to another (temporary) table and change the
>name ?
I use relations where the parent key and the child key are quite different. In one pair of tables (one of which I inherited) the key is numeric in the parent and character in the child. Both key fields have different names. My code looks like
SET ORDER TO Provider IN Providers
SELECT PedDemog
SET RELATION TO VAL(DistCode) INTO Providers
I've also used part of a key field. One table had an index on
PatientID + DTOS(VisitDate) DESCENDING
like "AB123420020501" and with NEAR ON you could SEEK the PatientID and come to the most recent visit.