Results 1 to 2 of 2
2014-07-09, 13:02 #1
- Join Date
- Jul 2014
- Thanked 0 Times in 0 Posts
How to get an unbound combo box to respond when the main form is filtered.
I have an Access 2010 Database that I use to manage all employee information. The main form has an unbound combo box that I use to navigate through employee records by selecting the employee name that I want to see a record for from the combo drop down list. When I toggle the form filter back and forth between Active and Terminated employees, the unbound combo box does not respond to the filter and still continues to list all employees whether active or terminated no matter how the form is filtered. Oddly though, when I filter the form to show only active employees and then use the form's navigation arrows to breeze through the employees in their sorted order, the unbound combo box cycles through right along with the form in that aspect only showing the filtered active employee names. Both the combo box and the form use the same query for their source data, however I assume that since the combo box is unbound that is why I am not able to get it to filter with the form. Is there a way to make this work?
The event procedures I'm currently using to make the combo box perform as a navigation tool are listed below and work flawlessly for navigating through All employees:
Main Form - On Current (this was added to make the combo box cycle when using the form navigation arrows)
Private Sub Form_Current()
Me.GoToRecordcbo = Me.FullName
Combo Box - On Click Macro (this is the macro that makes the form cycle to the selected record)
Search for Record Type
Where Condition: ="[fullName] = " & "'" & [Screen].[ActiveControl] & "'"
Combo Box Properties:
Control Source: (If I enter the actual field name here, the navigation function stops working)
Row Source: SELECT [1_2_3_Qry].[fullname] FROM 1_2_3_Qry ORDER BY [fullname];
Row Source Type: Table/Query
Like I said, the navigation function of the combo box works great and I have no issues with the above codes working. Now I would just like to get the combo box to filter when the form is filtered.
Any assistance is greatly appreciated.
TLM - Va.
2014-07-09, 17:52 #2
- Join Date
- Dec 2001
- Melbourne, Australia
- Thanked 26 Times in 26 Posts
You will have to requery the combo box.