how to populate field in another table

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top