INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Tips -N- Tricks

How to create a parent-child-grandchild form by mgagnon
Posted: 2 Nov 02

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:
  1. Use the database wizard and create a contacts database (for example) and select "populate the tables with dummy records".

  2. 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

  3. User the form wizard to create a one-to-many form using contacts and calls (calls being the child).

  4. Modify the form and in the dataenvironment add the description table (note the relationship is already there)

  5. 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.

  6. 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.

Mike Gagnon

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close