6
6afraidbecause789
Hello - there are 5 comboboxes in a subform from which users select
multiple staff involved in an incident. When a user selects a staff
person for one of the comboboxes, I'd like the name to be excluded or
filtered out of the other comboboxes. Or--and possibly better yet--
would be a way to check for duplicate StaffIDs right before saving the
subform record (becuase 1 staff person may have 2 titles or roles in
the incident) and msgbox the user if the duplicate Staff is
legitimate. Note that any one of the fields may be null.
cboStaff1
Control Source = Staff1ID
cboStaff2
Control Source = Staff2ID
cboStaff3
Control Source = Staff3ID
cboStaff4
Control Source = Staff4ID
cboStaff5
Control Source = Staff5ID
Staff1ID through Staff5ID are separate fields in the underlying table
named "Incidents", and are foreign keys to StaffID in a table named
"Staff."
But, the row source of each combobox is currently occupied with some
interesting code that I found online that puts an "Add New Staff"
option at the top of each combobox's list, reducing the number of
buttons needed on the form. Row Source = SELECT -999 as StaffID,
'<Add New Staff>' as StaffName, 'aaa' as StaffLastName, 'x' as
StaffFirstName, 'Ext.' as StaffExtension FROM qryStaff UNION SELECT
StaffID, StaffName, StaffLastName, StaffFirstName, StaffExtension FROM
qryStaff ORDER BY StaffLastName, StaffFirstName
Column Count = 5
Bound Column = 1
(This fires in the afterupdate when a user selects the "Add New
Staff")
Hope this makes sense. Thanks for any insights.
multiple staff involved in an incident. When a user selects a staff
person for one of the comboboxes, I'd like the name to be excluded or
filtered out of the other comboboxes. Or--and possibly better yet--
would be a way to check for duplicate StaffIDs right before saving the
subform record (becuase 1 staff person may have 2 titles or roles in
the incident) and msgbox the user if the duplicate Staff is
legitimate. Note that any one of the fields may be null.
cboStaff1
Control Source = Staff1ID
cboStaff2
Control Source = Staff2ID
cboStaff3
Control Source = Staff3ID
cboStaff4
Control Source = Staff4ID
cboStaff5
Control Source = Staff5ID
Staff1ID through Staff5ID are separate fields in the underlying table
named "Incidents", and are foreign keys to StaffID in a table named
"Staff."
But, the row source of each combobox is currently occupied with some
interesting code that I found online that puts an "Add New Staff"
option at the top of each combobox's list, reducing the number of
buttons needed on the form. Row Source = SELECT -999 as StaffID,
'<Add New Staff>' as StaffName, 'aaa' as StaffLastName, 'x' as
StaffFirstName, 'Ext.' as StaffExtension FROM qryStaff UNION SELECT
StaffID, StaffName, StaffLastName, StaffFirstName, StaffExtension FROM
qryStaff ORDER BY StaffLastName, StaffFirstName
Column Count = 5
Bound Column = 1
(This fires in the afterupdate when a user selects the "Add New
Staff")
Hope this makes sense. Thanks for any insights.