Ok, I take that back.
I've tried placing the code on various events, enter, exit, before Up, after up etc ... but they all seem to allow me to input a name incorrectly and the error box only occurs when editing the now duplicate input record.
The code is below, I've adjusted it for my purposes...