Hi. Assuming that in all cases Status has to be 'Yes', you need to OR the Class criteria, not AND them. However, you don't seem to be clear about what you are comparing, as you are using Like without using any wildcard characters for matching what goes before and after the string.
There is no need to use Like if you are after an exact match; the = operator is the right one for this. If you need partial matching you will need to use wildcard characters before and after the pattern, as shown below.
I have also used parenthesis for the OR part to ensure that the meaning of the statement and its execution sequence is clear. The AND is being done on the result of the OR, and the parenthesis just ensure that there is no doubt of the order in which they are interpreted.
Equals operator version
- DoCmd.ApplyFilter , "status = '" & kr & "' AND (class = '" & class1 & "' OR class = '" & class2 & "')"
Partial match version
- DoCmd.ApplyFilter , "status Like '*" & kr & "*' AND (class Like '*" & class1 & "*' OR class Like '*" & class2 & "*')"
-Stewart