Trouble associating parent form record to subform's record

M

Marty McDonald

I'll use make-believe table names to make things easier here. The
main form is bound to tblEngine. The subform is bound to tblPart.
But tblEngine has a foreign key to tblPart. While working on the main
form, I need to add a part (via the subform), then associate the
engine record to that part record. But even though I associate the
forms by the key & foreign key, the subform's record is inserted, but
not associated to the parent form record. I think it's because the
subform record is actually the parent. Using the subform "after
insert" event, I tried putting the new record's id into the main
form's foreign key field, but Access complained about the event source
not being available. Does anyone know how I can add the subform
record, then associate the main form record to it? Thanks
 
R

Rick Brandt

Marty said:
I'll use make-believe table names to make things easier here. The
main form is bound to tblEngine. The subform is bound to tblPart.
But tblEngine has a foreign key to tblPart. While working on the main
form, I need to add a part (via the subform), then associate the
engine record to that part record. But even though I associate the
forms by the key & foreign key, the subform's record is inserted, but
not associated to the parent form record. I think it's because the
subform record is actually the parent. Using the subform "after
insert" event, I tried putting the new record's id into the main
form's foreign key field, but Access complained about the event source
not being available. Does anyone know how I can add the subform
record, then associate the main form record to it? Thanks

Yeah, bound the parent table to the parent form and the child table to the
child form.

One engine has many parts right. To associate many records to one means
using the subform for the many side. This is not a place where "original
thinking" is your friend.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top