I've created a search form based on several unbound comboboxes. Two of them are cboTaskSearch and cboStatus. When the form opens, cboStatus is populated with all Status values and cboTaskSearch is populated with all Task values. When a user selects a value in the cboTaskSearch, the form will filter cboStatus to only values related to the task. My issue is that after the user searches and clears the values in the comboboxes, cboStatus will only display values based on the last search instead of the original list when the form opens. I've listed the code for cboTaskSearch and the Clear button. Thanks.
Clear button code
cboTask code
Clear button code
Code:
Private Sub btnClear_Click()
Me.cboAssigned = ""
Me.cboPriority = ""
Me.cboProject = ""
Me.cboStatus = ""
Me.cboTaskSearch = ""
Me.cboManager = ""
Me.qryTasks_subform1.Form.RecordSource = " SELECT * FROM qryTasks " & BuildFilter
Me.qryTasks_subform1.Requery
End Sub
cboTask code
Code:
Private Sub cboTaskSearch_AfterUpdate()
If IsNull(Me!cboTaskSearch) Or Len(Me!cboTaskSearch) = 0 Then
cboStatus.RowSource = [tblTaskStatusTypes].[StatusDescTx]
Else
cboStatus.RowSource = "SELECT StatusDescTx " & _
"FROM tblTaskStatusTypes " & _
"WHERE TaskTypeTx='" & Me!cboTaskSearch & "'"
End If
End Sub