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 or Function definition nested within the body of another definition.  A missing END SUB or END FUNCTION can also cause this error.