Rather than using code at all, you can just set the Validation Rule, as said by Cosmos, but then you just enter the message in the Validation Text property.