Using subforms in a tab control

G

gaugust

What I would like to accomplish:

1. Allow the user to filter records by selecting key field value in a combo
box in main form and having the records with the key field appear in
subforms.

2. Add new records to 3 tables using subforms in tab control.

My set-up
1. The 3 tables have a one-to-one relationship with a key field "serial" as
the key field in all 3 tables. Have a very long questionnaire and needed to
break-up fields in the questionnaire into 3 distinct tables.

2. Main form has a combo box that lists all serial numbers (a query on table
1 as the source for the combo box). Main form itself has no source.

3. Have three subforms in a tab control. Each subform has as it's source one
of the three tables. The subforms are tied to the main form by setting the
child link to the key field "serial" and the main form is tied to the
subforms by setting the link master to the name of the combo box.

Using the combo box to filter existing records is working. Entering new
records using the subforms is not. On subform 1 I enter the value for the
"serial" number key field. I then open subform 2. What I need is to have the
serial number on subform 1 passed to subform 2 and 3 so that the same key
field can be used to add records to tables 2 and 3. Currently getting the
error message "Index or primary key cannot contain a Null value" when I enter
values in subform 2. Not sure of the code needed to do this and which event
the code should go in.

Your reply would be greatly appreciated.
 

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