The form changes roles depending on what department is selected.
There is an input combo box that I can choose personnel from different departments.
I would like the combo box to default to the selected department. people can be borrowed from a different department
The code snippet looks up the ID in the table that matches the name of the selected department.
then tries to apply that to the combo box's ItemData property. I have tried many iterations 
Code:
Private Sub CBO_SelDept_AfterUpdate()
strDepartment = Me.CBO_SelDept.Column(0)
Dim DeptList As Long
DeptList = DLookup("[ID]", "Department_Personnel", "[Department] = '" & strDepartment & "'") 'works!
MsgBox DeptList 'It works!
Me.CBO_Department.ItemData (DeptList) 'Not working! :(
Me.CBO_Department.Requery
Me.CBO_ThorneID.Requery
End Sub
returns with
Compile error:
Invalid use of property
-Tevis