G
Guest
Hi
I have tables
Drivers (DriverID PK)
Warnings (WarningID PK)
DriversWarnings (DriverID and WarningID PK)
(Warnings are assigned to drivers in a many to many.)
I have a main form, showing info from the Drivers table and a continuous
subform, warnings, to show respective warnings for the driver. In the detail
section (ie for each record in the subform) there is a combo box where the
user can select a new warning to be assigned to a driver. There is a finite
list of 19 warnings possible for each driver. How can I prevent warnings
that are already assigned to the driver selected in the main form from
appearing in the combo in the subform so that the driver won't get duplicate
warnings assigned?
In a previous post the following query was proposed for the combo:
In the criteria box, for the WarningID, type
NOT IN (SELECT WarningID FROM WarningDrivers WHERE DriverID=
Forms![MainForm]!DriverID)
but I still haven't managed to get this to work. Maybe I'm doing something
wrong. I'm told that this will also prevent the previously selected warning
from appearing in records above on the continuos subform, and that I need to
put a textbox using a DLookup over the top of the combo to reflect this. I
haven't been able to work DLookup expression out either.
PLease help if you can. After much time spent on this, I will be very
grateful.
TIA
Rich
I have tables
Drivers (DriverID PK)
Warnings (WarningID PK)
DriversWarnings (DriverID and WarningID PK)
(Warnings are assigned to drivers in a many to many.)
I have a main form, showing info from the Drivers table and a continuous
subform, warnings, to show respective warnings for the driver. In the detail
section (ie for each record in the subform) there is a combo box where the
user can select a new warning to be assigned to a driver. There is a finite
list of 19 warnings possible for each driver. How can I prevent warnings
that are already assigned to the driver selected in the main form from
appearing in the combo in the subform so that the driver won't get duplicate
warnings assigned?
In a previous post the following query was proposed for the combo:
In the criteria box, for the WarningID, type
NOT IN (SELECT WarningID FROM WarningDrivers WHERE DriverID=
Forms![MainForm]!DriverID)
but I still haven't managed to get this to work. Maybe I'm doing something
wrong. I'm told that this will also prevent the previously selected warning
from appearing in records above on the continuos subform, and that I need to
put a textbox using a DLookup over the top of the combo to reflect this. I
haven't been able to work DLookup expression out either.
PLease help if you can. After much time spent on this, I will be very
grateful.
TIA
Rich