Just so you understand why your original code fails, you need to understand how the 'if' statement works with
or conditions.
Each 'or' separates different test conditions. Therefore your statement:
if RepCode is not "A10" or "A11" or "A12" or "A13" then...
(condensed for illustration) can be read as:
if (RepCode is not "A10") or ("A11") or ("A12") or ("A13")...
Each parentheses condition needs to stand alone as a valid true/false condition, so your first check sees if
RepCode is not "A10" then it checks if "A11" is true - there's no relationship between RepCode and A11 since they're two separate conditions.
The first way to change this is in the form:
if (RepCode is not "A10") and (RepCode is not "A11") and (RepCode is not "A12") and (RepCode is not "A13")...
but clearly that gets very verbose, hence Neil's suggestion to use a list and see if RepCode is in the list.
Note also the switch to using
and rather than
or since you want all the conditions to be true (RepCode doesn't match ANY of the values), otherwise it will return true if it matches ANY.