Error 476 - Block/scanned statements not allowed here

Block/scanned statements not allowed here - Block statements (like WHILE/WEND, DO/LOOP, and SELECT CASE) are not allowed in single line IF statements. In addition, you may not have a Sub, Function, Method, or Property definition nested within the body of another definition. A missing END SUB, END FUNCTION, END METHOD, or END PROPERTY can also cause this error.