how to populate field in another table

G

Guest

Is there a way/code you could use to take a field with an autonumber and
assign that same number to another table with the same field name when I
enter a new record in a form?

Resultstbl
resultID - PK Autonumber

Routetbl
resultID - FK number

Thanks
 
J

Jeff Boyce

Use a main-form/subform design. The main form holds the Resultstbl record.
The subform holds the (related) Routetbl record(s) (assumes a one-to-many
relationship).

If your Routetbl has its own primary key, this approach saves you the work
of assigning the Resultstbl PK to the foreign key field in Routetbl. Access
will automatically add the FK to the subform record if you've told the
subform control how the two (main/sub) are related.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Carbo87slevin

Jeff Boyce said:
Use a main-form/subform design. The main form holds the Resultstbl
record. The subform holds the (related) Routetbl record(s) (assumes a
one-to-many relationship).

If your Routetbl has its own primary key, this approach saves you the work
of assigning the Resultstbl PK to the foreign key field in Routetbl.
Access will automatically add the FK to the subform record if you've told
the subform control how the two (main/sub) are related.

Regards

Jeff Boyce
Microsoft Office/Access 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