combo box problem

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have read thru the posts for the past year, and have tried what they said, but
I'm still having a problem. I have two combo boxes that I want tied together.
The first is for Departments. The second is for Divisions within each
Department. I don't want anyone to be able to select a Division that doesn't
exist in a Department.

My tables:

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

My combo boxes:

cboDepartments
--------------
After update [EVENT]

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

cboDivisions
------------
nothing

Any help would be appreciated. Thanks a lot,

Tom
 
It would help if you would describe the symptoms of the
problem e.g. is it that the dropdown list is not being
populated. It would also help to know the RowSource SQL
for the other combo and its Bound Column.

Gerald Stanley MCSD
 
Got it, thanks.
-----Original Message-----
It would help if you would describe the symptoms of the
problem e.g. is it that the dropdown list is not being
populated. It would also help to know the RowSource SQL
for the other combo and its Bound Column.

Gerald Stanley MCSD
-----Original Message-----
I have read thru the posts for the past year, and have tried what they said, but
I'm still having a problem. I have two combo boxes
that I
want tied together.
The first is for Departments. The second is for
Divisions
within each
Department. I don't want anyone to be able to select a Division that doesn't
exist in a Department.

My tables:

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

My combo boxes:

cboDepartments
--------------
After update [EVENT]

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

cboDivisions
------------
nothing

Any help would be appreciated. Thanks a lot,

Tom

.
.
 
Back
Top