Edit: Sorry Aytyee111, didn't know you were providing more code.
The dynamic Where code as aytee111 listed is best if you have multiple search fields. You put it in the After Update of each combo box or you can make it a function and call that function it in the AfterUpdate of each combo box:
sWhere = null
if not isnull(cboState) then sWhere = sWhere & " and [LineName]='" & me.cboLineName & "'"
if not IsNull(txtName) then sWhere = sWhere & " and [ProjectType]='" & Me.ProjectTypeCbo & "'"
So lets say at this point you selected "AA" for LineName and "BB" for ProjectType in your combo boxes, the sWhere line would read:
sWhere =" and [LineName]='AA' and [ProjectType]='BB'"
if IsNull(sWhere) thenme.filterOn = false
else'remove 1st And
sWhere= mid(sWhere,4) 'this line gets rid of the beginning " and" in the where clause. So now it reads
sWhere =" [LineName]='AA' and [ProjectType]='BB'"
'just use the filter
me.filter = sWhere
me.filterOn = true
end if
So the above only uses 2 search fields(combo boxes) but you see the benefit in that you can add as many search lines as you want and the rest of the code builds the where clause as needed. If you had 5 search combo boxes and they select combobox 2 and combobox 5 and leave others blank, then this code will create a where clause for only those 2 fields to search on.