0
votes

Microsoft Access: I have a form, it contains a combo box for 'Primary Key 1', 'Primary Key 2', 'Data A' and 'Data B'. Each combo box has a list of values to choose from. When I create a new record, how can I set up the form so that: the value for 'Primary Key 1', 'Primary Key 2' and 'Data A' are moved into 'Table A'; and the value for 'Primary Key 1', 'Primary Key 2' and 'Data B' are moved into 'Table B'.

The issue here is getting the values set for the two primary keys into two tables.

Form:
Primary Key 1
Primary Key 2
Data A
Data B

Table A:
Key 1
Primary Key 2
Data A

Table B:
Primary Key 1
Primary Key 2
Data 2

1

1 Answers

0
votes

Bound the form to query with both tables joined, bound primary key comboboxes to one of table, Access will copy the data to primary key of second table automatically. Primary keys in both tables should be indexed as primary keys, join in this case will be one-to-one.

Bound the rest of data fields as usual.