*////////////////////////////////////////////////////////////////// * Setup. *////////////////////////////////////////////////////////////////// CREATE CURSOR invoices (cno c(5), ino N(4,0)) INSERT INTO invoices (cno, ino) VALUES ("B9278",1106) INSERT INTO invoices (cno, ino) VALUES ("B9278",1107) CREATE CURSOR detail (ino N(4,0), pno c(5)) INSERT INTO detail (ino, pno) VALUES (1107,"AAAAA") INSERT INTO detail (ino, pno) VALUES (1107,"BBBBB") INSERT INTO detail (ino, pno) VALUES (1107,"CCCCC") INSERT INTO detail (ino, pno) VALUES (1106,"AAAAA") INSERT INTO detail (ino, pno) VALUES (1106,"BBBBB") SELECT detail INDEX ON ino TAG ino SET ORDER TO ino SELECT invoices INDEX ON cno TAG cno SET ORDER TO cno SET VIEW ON *////////////////////////////////////////////////////////////////// * "1-M" Relation. *////////////////////////////////////////////////////////////////// WAIT WINDOW "(1-M) Notice how the relation looks in the view"+ ; CHR(13)+"Press ESC to continue" NOWAIT SELECT invoices SET RELATION TO ino INTO detail SET SKIP TO detail && NOTE: "1-M" ?! SELECT invoices LOCATE BROWSE FIELDS invoices.ino, detail.pno NOWAIT ACTIVATE WINDOW invoices ON KEY LABEL ESC CLEAR EVENTS READ EVENTS ON KEY LABEL ESC RELEASE WINDOWS Invoices *////////////////////////////////////////////////////////////////// * "1-1" Relation. *////////////////////////////////////////////////////////////////// WAIT WINDOW "(1-1) Notice how the relation looks in the view"+ ; CHR(13)+"Press ESC to continue" NOWAIT SELECT invoices SET RELATION TO ino INTO detail SET SKIP TO && NOTE: "1-1" ?! SELECT invoices LOCATE BROWSE FIELDS invoices.ino, detail.pno ; NAME o_Browse1 NOWAIT SELECT detail BROWSE FIELDS invoices.ino, detail.pno ; NAME o_Browse2 NOWAIT o_Browse1.Height = 200 o_Browse2.Top = 200 o_Browse2.Height = 200 ACTIVATE WINDOW invoices ON KEY LABEL ESC CLEAR EVENTS READ EVENTS ON KEY LABEL ESC CLEAR ALL *////////////////////////////////////////////////////////////////// * EOF. *//////////////////////////////////////////////////////////////////>I'm still a little new to FoxPro, and having issues linking tables together. I have two tables, set up with an appropriate automaticly defined primary key(numerical field, with a default value of "recno()" ), and FoxPro wont let me create any relationship between the two table except a one to one relationship, which is not what i want, and besides that it doesnt work right. I need a one to many relationship. On top of this, FoxPro is working just fine pulling data from the one table, yet will only pull one record from the other(its not updating the form at all), despite the query changing for both tables. Im not sure really how to explain it clearly, but thats the best way to describe it i can come up with. Any suggestions on how to fix this would be welcome