How do you add the auto created key to subsequent tables

  • Thread starter Thread starter ConnieT
  • Start date Start date
C

ConnieT

This is my first time creating a access application and would like to
use a auto created sequence id when the user first logins in as the key
for each subsequent table entry. I want to push the key out to the
other tables so I don't have redundant data. How would I copy this key
into the other tables? I use forms with sub forms for data entry and
would like for this to happen in the back ground.

Thanks in advance for your help.
 
Hi Connie,

I'm not sure what you mean by "auto created sequence id". But Access's
Autonumber field type automatically assigns a unique number to every new
recor.

If you
1) have an Autonumber field with a unique index (typically, use it as
the primary key) in the "main" table
2) have Number (long) fields as foreign keys in the related tables
3) create the appropriate relationships between the tables
4) use these related fields to link the main form and the sub forms
- then what you want happens automatically.


If this isn't what you have in mind, post in the FormsCoding group, and
give some more information about your tables.
 
Hi,
I did as you suggested and created the one to many relationship with
main table to each table with the autonumber field. Then created sub
forms with the master/child relationship and it does not update the
fields.
Thanks
Connie
 
Maybe I misunderstood what you meant. What I had in mind was a classic
one to many relationship (e.g. that in the Northwind sample database
between Orders and OrderDetails, where OrderID is an autonumber primary
key of the Orders table, and the Orders form contains an Order Details
subform, with form and subform linked by the OrderID field.

But this newsgroup is for questions about handling external data, not
table design or coding. I suggest you post again, with a fuller and
clearer explanation, in the formscoding or tablesdbdesign groups.
 
Back
Top