>I have a table1 and table2.
>
>table1 and table2 have the same primary key. If i set relation with these two key, how can I make them work in the form.
>
>For example, table1 is the customer data table which have "customer" as the primary key, and in table2 in the invoice table, which also have the "customer" primary key.
>
>How can I make table2 to have a new "customer"(same as table1's primary key) value, when every time I append a new record in table1?
>
>Where should I put the codes and what is it?
>
>Thank you. I am using VFP5.0 and is a novice.
Tan,
In database designer, set table2's primary key default value as table1.pkey and relate them there. Whenever you design a new form with these tables, open dataenironment of form and put both. Relation would be automatically set.
cetin