S
Sue R via AccessMonster.com
I have read through here and used Microsoft's site to write the code for
cascading combo boxes but am receiving an error on the first combo box
selection "The expression After Update you enterd as the event property
setting produced the following error:Expected:identifier.
It's a simple db - Three tables
tblMain (all staff data)
tblDepartment (ID, Department)
tblUnit (ID, Unit, Department, DepartmentID)
One main form that I have 2 combo boxes on. The first combo box
(cbxDepartment) should drop down the possible Departments and the second
combo box (cbxUnit) should choose from possible units based on the Department
chosen in the first.
Using the instructions and code from the MS site, this is what I have in the
first Combo box (cbxDepartment):
Row Source Type - Table/Query
Row Source tblDepartment
After Update/Event Procedure:
Option Compare Database
Private Sub
End Sub
Private Sub cbxDepartment_AfterUpdate()
Me.tblUnit.RowSource = "SELECT Unit FROM" & _
" tblUnit WHERE DepartmentID = " & Me.tblDepartment & _
" ORDER BY Unit"
Me.tblUnit = Me.tblUnit.ItemData(0)
End Sub
Private Sub Unit_AfterUpdate()
End Sub
Private Sub cbxDepartment_AfterUpdate()
End Sub
And on the second combo box (cbxUnit)
Row Source Type - Table/Query
Any suggestions would be greatly appreciated.
Thanks
Sue
cascading combo boxes but am receiving an error on the first combo box
selection "The expression After Update you enterd as the event property
setting produced the following error:Expected:identifier.
It's a simple db - Three tables
tblMain (all staff data)
tblDepartment (ID, Department)
tblUnit (ID, Unit, Department, DepartmentID)
One main form that I have 2 combo boxes on. The first combo box
(cbxDepartment) should drop down the possible Departments and the second
combo box (cbxUnit) should choose from possible units based on the Department
chosen in the first.
Using the instructions and code from the MS site, this is what I have in the
first Combo box (cbxDepartment):
Row Source Type - Table/Query
Row Source tblDepartment
After Update/Event Procedure:
Option Compare Database
Private Sub
End Sub
Private Sub cbxDepartment_AfterUpdate()
Me.tblUnit.RowSource = "SELECT Unit FROM" & _
" tblUnit WHERE DepartmentID = " & Me.tblDepartment & _
" ORDER BY Unit"
Me.tblUnit = Me.tblUnit.ItemData(0)
End Sub
Private Sub Unit_AfterUpdate()
End Sub
Private Sub cbxDepartment_AfterUpdate()
End Sub
And on the second combo box (cbxUnit)
Row Source Type - Table/Query
Any suggestions would be greatly appreciated.
Thanks
Sue