Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not a problem

Status
Not open for further replies.

Custer

Programmer
May 4, 2000
8
CA
Hello, this is not to report a problem, just something strange.<br>Maybe it's already known, maybe not.<br>Ok, I had to create a form to update 3 tables in one-to-many relationships like this: TABLE1 --&gt;(one-to-many rel 1:N)--&gt; TABLE2--&gt;(one-to-many rel 1:N)--&gt; TABLE3.<br>Each record of table1 may have many related records in table2, in turn each record in table2 may have many related records in table3. I use a pageframe with 2 pages, page 1 updates TABLE1, and page 2 is divided in 2: the top contains fields to update TABLE2 and the bottom <br>contains a grid for TABLE3 with the following properties: <br>&nbsp;&nbsp;recordsource=&quot;TABLE3&quot;, linkmaster=&quot;TABLE2&quot;, relationalexpr=&quot;keyfield&quot;, childorder=&quot;keyindex&quot;.<br>Ok so far so good.&nbsp;&nbsp;The problem was, the grid always showed all the records in TABLE3.&nbsp;&nbsp;My original solution was to do a SET KEY TO every time the user moved the record in the parent table TABLE2.<br>But now there are many tens of thousands of records in TABLE3 and even set key to is too slow every time the grid is refreshed.<br>So I looked hard and finally I found the solution, and it's really silly: just add in the grid.refresh() method a SELECT TABLE2 (the parent table of the table in the grid).&nbsp;&nbsp;Now the grid displays the correct records of TABLE3 which are related to the current record in TABLE2.<br>The thing is, you don't have to do this when it's a simple one-to-many rel form with 2 tables, but with 3, the grid will not be able to handle the 2 relationships.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top