G
Guest
Hi
I am trying to learn how to add records in a many to many relationship. I
have spent many hours trying! Here is the setup:
Vehicles table, primary key: VRM (unique identifier)
Drivers table, primary key: DriverID
These two tables are joined to a junction table, VehiclesDrivers, primary
keys VRM and DriverID
Warnings table, primary key: WarningID
Drivers and Warnings tables are also in a many to many relationship and use
the following junction table:
WarningsDrivers table, primary keys WarningID and DriverID
So there are two many to many relationships.
The Warnings table consists of 19 set values which will not be changed. I
need to use a combo box to be able to select and assign multiple warnings for
each driver. I have a main form (vehicles) and a subform, drivers. On this
subform, drivers associated with the vehicle are listed.
I think I have figured out how to add new drivers to the vehicle using the
subform... I can just type them in on the form.
What is confusing me is how I can add new warnings to the drivers. I have a
combo box to list each of the 19 possible warnings. I have set the row
source to Warnings so the 19 fields are listed in the combo.
The Control Source is set to WarningID. I am confused as I have just
found that entries have been written to the warnings table duplicating the
warning values! How do I write to the junction table (DriversWarnings?)
Thank you in advance. I am trying very hard and need to get this sorted...
my living depends on it!
rich
I am trying to learn how to add records in a many to many relationship. I
have spent many hours trying! Here is the setup:
Vehicles table, primary key: VRM (unique identifier)
Drivers table, primary key: DriverID
These two tables are joined to a junction table, VehiclesDrivers, primary
keys VRM and DriverID
Warnings table, primary key: WarningID
Drivers and Warnings tables are also in a many to many relationship and use
the following junction table:
WarningsDrivers table, primary keys WarningID and DriverID
So there are two many to many relationships.
The Warnings table consists of 19 set values which will not be changed. I
need to use a combo box to be able to select and assign multiple warnings for
each driver. I have a main form (vehicles) and a subform, drivers. On this
subform, drivers associated with the vehicle are listed.
I think I have figured out how to add new drivers to the vehicle using the
subform... I can just type them in on the form.
What is confusing me is how I can add new warnings to the drivers. I have a
combo box to list each of the 19 possible warnings. I have set the row
source to Warnings so the 19 fields are listed in the combo.
The Control Source is set to WarningID. I am confused as I have just
found that entries have been written to the warnings table duplicating the
warning values! How do I write to the junction table (DriversWarnings?)
Thank you in advance. I am trying very hard and need to get this sorted...
my living depends on it!
rich