combo box problem

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

Tom

I've read the posts for last year, but I'm still having a problem I can't
identify.

I have two 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

On my form I have a combo box for each. On the Dept combo box, AfterUpdate
property, I have set up the following event procedure:

Private Sub cboDepartments_AfterUpdate()

Me.cboDivisions.RowSource = "SELECT * FROM" & _
" Divisions WHERE DeptID = " & Me.cboDepartments & _
" ORDER BY Description"
Me.cboDivisions = Me.cboDivisions.ItemData(0)

End Sub

I finally got past my compile errors, but when run it, the Division combo box is
always empty, and has a horizontal scroll bar.

Anyone have any idea what I'm doing wrong? Or not doing? Your help is
appreciated. Thanks.
 
If Me.cboDepartments contains the Description of the
department rather than its Id, then that would explain why
cboDivisions is not being populated.

Hope This Helps
Gerald Stanley MCSD
 
Back
Top