Hi, I have a form with two comboboxes on it and I can get it to output from both of them from one query when a button is pushed, however I can only get one to work at a time. It is set up that there is one table and each combobox filters entries by one column each (one is for ASSET TYPE and the other is for EVENT) so that when the button is pushed, a table is created filtered by these two options. Right now, it filters by ASSET TYPE then EVENT, however the second overwrites the first each time. I know that the first search works as well since I can comment out the second and it filters by ASSET TYPE instead. How can I change this so it filters by the first AND the second?
****
CODE:
If Combo10.Value & "" = "" Then 'If none picked, show all
strWHERE = ""
Else
strWHERE = "WHERE [ASSET TYPE]='" & Combo10.Value & "'"
End If
If Combo14.Value & "" = "" Then
strWHERE2 = ""
Else
strWHERE2 = "WHERE [EVENT]='" & Combo14.Value & "'"
End If
SQL = "SELECT " & strSelect & " FROM [TransmissionInformation] " & strWHERE
CurrentDb.QueryDefs("FindAssetFormQuery").SQL = SQL
SQL = "SELECT " & strSelect & " FROM [TransmissionInformation] " & strWHERE2
CurrentDb.QueryDefs("FindAssetFormQuery").SQL = SQL
DoCmd.OpenQuery "FindAssetFormQuery"
DoCmd.Close acForm, "AssetNumberMenuForm", acSaveYes
***
I am very new to access and this type of coding, so any help is appreciated... I've tried to be as descriptive as possible, but hopefully it's not confusing. Thanks!