Adding an Auto Number Field (1 Viewer)

jboyle

New member
Local time
Today, 13:02
Joined
Nov 18, 2000
Messages
53
I have a main table and a subtable. The unique field is called container ID. This container ID is in both tables to support the link as the master and child field. However I now have a need to add an autonumber to be able to perform other functions. I added the autonumber to the main table with no problem, but I don't know how to add the autonumber to the subtable.
EXAMPLE:
Main Table ID Container ID
1 A6554-3
2 B6678-2

Subtable ID Container ID Contents
need this ID 1 A6554-3 Hammers
need this ID 1 A6554-3 Nails
need this ID 2 B6678-2 Saws
need this ID 2 B6678-2 Plyers

Thanks in advance - John
 

Fornatian

Dim Person
Local time
Today, 13:02
Joined
Sep 1, 2000
Messages
1,396
If the ContainerID is unique why have a second primary key performing only a bookmarking function when you already have a 'useful' unique ID?

Anyway to answer your question, use an update query to update the subtable's linkfield with the new primary.

Note that the subtable update field should not be a Autonumber type field. It can duplicate across numerous records, so it should be a Long Integer number field.

Another autonumber field can be added to the subtable separately if required.
 

Users who are viewing this thread

Top Bottom