use address in 0 order id_addr
use customer in 0
select customer
set relation to id_addr into address
locate for customername = "ABC co" && moves the pointer in address
replace id_addr with X
if seek( "address", id_addr )
? "New address found. address table on record:", recno( "address" )
else
? "No such address ID. address table at EOF():", eof("address")
endif
or
seek id_addr in address
if found()...
If you are looking for a more elegant or obvious way, I don't think it exists.
on Terminology: You have me questioning my understanding of what Parent and Child refer to. Why do you consider the customer table the parent? Unless I am misunderstanding your example, many customers can have the same address record and each customer can have only one address record. If parent records can have many child records and child records can have only one parent, then Address is the parent, and Customer is the child. If it is a one to one relationship, I would think that the child is still the one with a field that holds the other tables primary key. The help for SET RELATION does not agree with this, and therefore I do not agree with it. Of course after looking in two books, I can't find any real definitions. I did find "if two or more vertices have the same parent, they are siblings to each other." I am not sure that helps.
>Hi Carl,
>
>This is what I meant:
>
>The Customer is the parent table with a forgiegn key id_addr to the address primary key, id_addr
>
>If I replace Cust.id_addr, the address table doesn't repostion itself to the correct record until I move the parent. Right now I use: GO RECNO() and was curious to another way where I don't have to move either of the files at all.