T
Tom
I've read thru the last years worth of msgs, but am still having a problem with
my two combo boxes. I want the second to be tied to the first, only displaying
those divisions particular to the selected department.
Here are my tables (just a portion):
DeptID Description
------ -----------
11 City Council
13 Executive
15 Admin - General
26 Judicial
32 Admin - Police
33 Admin - Fire
35 Fire Dept.
38 Public Safety
42 Public Works
DeptID DivisionID Description
------ ---------- -----------
38 0 E-911 Communications
46 0 Fleet Maint - Garage
47 0 Public Utilities
32 0 Support Services
11 10 City Council
13 10 Mayor
15 10 Finance
I have two combo boxes:
cboDepartments
cbo Divisions
I have [Event] code in After Update for cboDepartments:
Private Sub cboDepartments_AfterUpdate()
Me.cboDivisions.RowSource = "SELECT * FROM" & _
" tblDivisions WHERE DeptID = " Me.cboDepartments &
" ORDER BY Description"
Me.cboDivisions = Me.cboDivisions.ItemData(0)
End Sub
But I can't get it to work. I keep getting a compile error.
At one time I tried something like Me.cboDivisions.Requery. That didn't work
either.
If anyone could shed some light on this, I surely would appreciate it.
Thanks in advance,
Tom
my two combo boxes. I want the second to be tied to the first, only displaying
those divisions particular to the selected department.
Here are my tables (just a portion):
DeptID Description
------ -----------
11 City Council
13 Executive
15 Admin - General
26 Judicial
32 Admin - Police
33 Admin - Fire
35 Fire Dept.
38 Public Safety
42 Public Works
DeptID DivisionID Description
------ ---------- -----------
38 0 E-911 Communications
46 0 Fleet Maint - Garage
47 0 Public Utilities
32 0 Support Services
11 10 City Council
13 10 Mayor
15 10 Finance
I have two combo boxes:
cboDepartments
cbo Divisions
I have [Event] code in After Update for cboDepartments:
Private Sub cboDepartments_AfterUpdate()
Me.cboDivisions.RowSource = "SELECT * FROM" & _
" tblDivisions WHERE DeptID = " Me.cboDepartments &
" ORDER BY Description"
Me.cboDivisions = Me.cboDivisions.ItemData(0)
End Sub
But I can't get it to work. I keep getting a compile error.
At one time I tried something like Me.cboDivisions.Requery. That didn't work
either.
If anyone could shed some light on this, I surely would appreciate it.
Thanks in advance,
Tom