kengooch
Member
- Local time
- Yesterday, 23:49
- Joined
- Feb 29, 2012
- Messages
- 137
I have a form "fStaff" that is populated by a query "qStaff" with over 3000 records. The user can click a button "bCITC" which sets a filter to only show the records for employees who work in CITC. Once they click that filter button on the form to isolate the records to a subset. However, the Combobox still shows all the names! How do I tell the combo box to only show the records that the filter sets?
Code:
'This is the code that sets the filter to only look at the CITC Staff
Private Sub bCITC_Click()
CITC = "[tStfDept] = 8"
Me.Filter = CITC
Me.FilterOn = True
DoCmd.SetOrderBy "tStfLstNm ASC, tStfFstNm ASC"
DoCmd.GoToControl "luStaff"
End Sub
'This is the code that does the record lookup on the form.
Private Sub vLUName_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[vStfFullNm] = '" & Me![vLUName] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
DoCmd.GoToControl "vLUName"
Me![vLUName] = Null
End Sub