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!

Populating a child table (subformdatasheet) on the fly!

Status
Not open for further replies.

ItsDouglas

Programmer
Aug 4, 2004
11
US
Hopefully someone has this answer:
Scenario:
I have a form with a tab control. On one of the tabs is a datasheet form. The datasheet form has a subdatasheet form. The relationships are working find between the subform and it's child datasheet form. But what I need to do is the following: When the user clicks on the '+' symbol while in the subform's datasheet view, I need to check to see if child records exist, if they don't then I need to create 8 records within the child table and populate one of the 4 columns with data from a completely different table. (I would prefer this auto-populate of the 8 records to grab data via a lookup ID instead of me hard-coding the values). So, the final result should be when the user clicks on the '+' symbol, if there are child records available (it will be 8 records every time) then those 8 records are displayed. But if the child records have not been created yet for that particular row, then I need to add the 8 rows to the child table "on the fly" and populate one of the colums in the child table with a looked-up value from a third table. Because the Parent table is populated with imported data from MS Project 2003, I will never know, within code, which parent records have the 8 children records created yet. Hence why I think I need to do this on the fly. I am finding the tough part is not creating ANOTHER 8 records when the user clicks on the '+' if there are already child records there.

Clear as mud? ;-) Any help appreciated!
Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top