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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a parent-child-grandchild form

Tips -N- Tricks

How to create a parent-child-grandchild form

by  Mike Gagnon  Posted    (Edited  )
The Parent->child->grandchild (persistant) relationship works on the same principle as the parent child relationship, the only difference is that once you move to record pointer of the parent table, it will show the appropriate records in the child table ( a grid in this instance) but, since the child table may or may not have children of their own, the user would have to click on the desired record on the child grid, to move that pointer and reflect the appropriate grandchild records.
How to recreate this behavior:
[ol][li] Use the database wizard and create a contacts database (for example) and select "populate the tables with dummy records".[/li]
[li]Lets use the contacts and calls tables. And create another table (description) with two fields. Call_id (interger) and description (c(20)). Create a regular index on the call_id field and in the database "drag" the call_id field from the calls table to the description->call_id field. Populate the table with a couple of records, using the appropriate call_id numbers[/li]
[li] User the form wizard to create a one-to-many form using contacts and calls (calls being the child). [/li]
[li] Modify the form and in the dataenvironment add the description table (note the relationship is already there)[/li]
[li]Add a second grid with the grid builder and put the two fields in the grid and make sure the relationshipship is set in the relationship tab.[/li]
[li] Run the form and move the record pointer, and once you get to the record that has a grandchild record (if it's not the first record in the child grid) click on the record in the child grid and the correct records in the grandchild grid should appear.[/li][/ol]
Mike Gagnon
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top