` Printed Icetips Article

Icetips Article



Par2: Duplicate parent records in browse
2002-12-05 -- Andy Stapleton
 
> I have two tables.  TABLE_A and TABLE_B.  The two tables are related to
each
> other in a one to many relationship.  When I create a browse and I include
> both tables in the browse and put the "One" table as my primary table and
> the "Many" table as my related table, I end up getting apparently random
> duplicate records appearing in my browse.  

your problem is standard for SQL,

when you Use a Join with the parent / Child it will give you multiple
parents for each child . no way around...

now to solve your problem.....

legacy or otherwize.....(eaiser in legacy..)

change the browse to a CHILD-PARENT so it is a lookup instead

look in the source and find where they do a POSITION(VIEW).

substitute and hold the primary key elements for the parent record.

then before the code to call the update(parent of course).

  do a REGET() on the position of the parent record, OR just grab the
primary key items you saved of the parent and get the record again just
before the call of the update/ delete..



Printed November 23, 2024, 2:20 am
This article has been viewed/printed 35312 times.