I am trying to filter records based on 2 combo boxes. Using the following code, Access recognizes the Field to search as combo18.text (strField), yet it displays an input box and requests a parameter for the 2nd combo box (combo28.text or strField) and shows the item selected in the 2nd combo box as instructions for the parameter.
I am at a loss as to how to get the 2nd combo box to be accepted as the item to search for without the user having to manually enter a Parameter into an input box.
The following text is contained in a click event for a command button named 'cmdSearch'. The combo boxes are contained on a form which is based on a query.
If anyone can point out what I doing wrong or suggest another method to achieve the desired results I would appreciate it....
strField = Combo18.text
strCriteria = Combo28.Text
strCriteria = strCriteria & " and " & "([Date]) >= [BeginningDate]"
strCriteria = strCriteria & " and " & "([Date]) <= [EndingDate]"
strField = Me![Combo18]
strSearch = strField
strSearch = strField & " like " & strCriteria
Forms!Search.FilterOn = True
Forms!Search.Filter = strSearch
Thanks....
I am at a loss as to how to get the 2nd combo box to be accepted as the item to search for without the user having to manually enter a Parameter into an input box.
The following text is contained in a click event for a command button named 'cmdSearch'. The combo boxes are contained on a form which is based on a query.
If anyone can point out what I doing wrong or suggest another method to achieve the desired results I would appreciate it....
strField = Combo18.text
strCriteria = Combo28.Text
strCriteria = strCriteria & " and " & "([Date]) >= [BeginningDate]"
strCriteria = strCriteria & " and " & "([Date]) <= [EndingDate]"
strField = Me![Combo18]
strSearch = strField
strSearch = strField & " like " & strCriteria
Forms!Search.FilterOn = True
Forms!Search.Filter = strSearch
Thanks....