D
David S. Mohler
Hello,
I'm a bit of a novice at using code to manipulate my Access queries.
I have set up a database that has 3 tables:
Jobs
Locations
Jobs_Locations
Jobs_Locations is a junction table. A job can be in many locations, and each
location can have many jobs. Using the junction table, I can look up all
jobs where LocationID = X, or all locations where JobID = Y. This works
fine.
The Jobs and Locations tables each have an autonumber field for the primary
key. These are foreign keys in Jobs_Locations.
When I add a new Job to Jobs using an "INSERT INTO Jobs" query, is there a
way to immediately retrieve the new ID assigned by the Autonumber? That way,
I can immediately update the junction table with the new JobID and specify
each location that applies for that JobID.
How is this normally done?
Thanks,
Dave
I'm a bit of a novice at using code to manipulate my Access queries.
I have set up a database that has 3 tables:
Jobs
Locations
Jobs_Locations
Jobs_Locations is a junction table. A job can be in many locations, and each
location can have many jobs. Using the junction table, I can look up all
jobs where LocationID = X, or all locations where JobID = Y. This works
fine.
The Jobs and Locations tables each have an autonumber field for the primary
key. These are foreign keys in Jobs_Locations.
When I add a new Job to Jobs using an "INSERT INTO Jobs" query, is there a
way to immediately retrieve the new ID assigned by the Autonumber? That way,
I can immediately update the junction table with the new JobID and specify
each location that applies for that JobID.
How is this normally done?
Thanks,
Dave