Updating master/detail with form and subform

P

Peter Lux

I have a master table (sale) and multiple items on that sale (sale_item) I
want to create a data entry screen so that they have combo boxes for the
master table, then a datasheet subform for the sale_item records. Can anyone
point me to some code to do this? I want to instert into both the sale and
sale_item tables at the same time. I've created text boxes for the sale, but
I'm not sure how to create the subform for the sale_item and hook it into
the insert.

I'd love to use some ADO code to do this but I'm not sure how to reference
the textboxes and comboxes on the forms for the update.

Thanks in advance..
 
J

John Vinson

I have a master table (sale) and multiple items on that sale (sale_item) I
want to create a data entry screen so that they have combo boxes for the
master table, then a datasheet subform for the sale_item records. Can anyone
point me to some code to do this? I want to instert into both the sale and
sale_item tables at the same time. I've created text boxes for the sale, but
I'm not sure how to create the subform for the sale_item and hook it into
the insert.

I'd love to use some ADO code to do this but I'm not sure how to reference
the textboxes and comboxes on the forms for the update.

Thanks in advance..

You're going to FAR more effort than you need.

Create a Form based on the Sale table. Use the Subform Wizard to
create a subform based on sale_item. I'd use a Continuous form rather
than a datasheet (you can make it *look* like a datasheet if you
want); use the SaleID as the master/child link field.

No ADO code or any other code is needed to update the database; Access
takes care of all of that for you.

John W. Vinson[MVP]
 

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