Be sure after your command line "THISFORM.cmdNewmaster.SETFOCUS()"
there is no other command like "KEYBOARD '{ENTER}'". Also, be sure
in the event GotFocus of your button there is no call to the click method.
Also, try the command NODEFAULT() in the setfocus method of your button.