Hwa Song,
Instead of making your relations in the DataEnvironment by linking the tables, do them with code as Cetin suggests. Relations in the DataEnvironment are not always stable. I have found that the order the tables were added to the DataEnvironment sometimes makes a difference.
Also, if you use SEEK where appropriate you may not need to use SET RELATION at all. Usually SEEK will be faster than linking multiple tables together, because when you move the record pointer you only have to update one table.
HTH
Barbara
>Hi Cetin,
>How are you??
>Before I came back here, I've read books to figure this problem out,
>but I found none.
>So, I came here again to ask people in here and pros like you to see
>if you can help me.
>Let me clearly readdress the problem.
>I have a form called 'inventory', and in the Data Environment in this
>form, I've added inventry, invent_line_items, supplier, and products table.
>However, each table gets relation with primary index, but one in the product
>table and invent_line_items table won't make a relationship together.
>I thought it was so because the product.product_id(primary) relationship was
>bond with order_line_items.product_id.
>So I've set the product.product_id to candidate and add one more index called
>invent to see if this work. But this didn't help much.
>But in the process of fixing this problem, I've found one puzzle piece;
>the order form which it's data environment has orders, product, customer,
>order_line_items & etc., and I've inserted the invent_line_items to see
>if program make a connection between product.product_id and invent_line_items.
>product_id and it did.
>Now.. if these two form(orders and inventory) were excerpt from same class,
>why one does work and other doesn't?
>
>PS.
>in the inventory form, I've insert order_line_items table in data environment
>to see if product_id make relationship and only product.product_id and
>order_line_items.product_id made a relationship.
>
>Thank you again..