I’ve successfully managed to implement Cascading Combo Boxes into my new database.
Quick overview:
cboOrg is the main combo box
cboDept values are dependent on cboOrg selection.
Now all this works fine.
However, I need to add one value (let’s call this ‘Dept X’)’ to all the Organisation sub-data.
What the selectable criteria currently looks like...
cboOrg: Org A
cboDept: Dept A, Dept G, Dept T
What I want to achieve...
cboOrg: Org A
cboDept: Dept A, Dept G, Dept T, Dept X
So no matter what value I select in cboOrg. ‘Dept X’ should always appear in cboDept.
Any idea how I can do this?
The only way I can think of how to do this is tedious and not a very good solution. It would involve me going back and manually adding ‘Dept X’ to every single Org.
Should it help, this is the code I’m using:
Thank you for any help!
Quick overview:
cboOrg is the main combo box
cboDept values are dependent on cboOrg selection.
Now all this works fine.
However, I need to add one value (let’s call this ‘Dept X’)’ to all the Organisation sub-data.
What the selectable criteria currently looks like...
cboOrg: Org A
cboDept: Dept A, Dept G, Dept T
What I want to achieve...
cboOrg: Org A
cboDept: Dept A, Dept G, Dept T, Dept X
So no matter what value I select in cboOrg. ‘Dept X’ should always appear in cboDept.
Any idea how I can do this?
The only way I can think of how to do this is tedious and not a very good solution. It would involve me going back and manually adding ‘Dept X’ to every single Org.
Should it help, this is the code I’m using:
Code:
Private Sub Organisation_AfterUpdate()
On Error Resume Next
Department.RowSource = "Select tblService_Users.Department " & _
"FROM tblService_Users " & _
"WHERE tblService_Users.Organisation = '" & Organisation.Value & "' " & _
"ORDER BY tblService_Users.Department;"
End Sub
Thank you for any help!