SysQueryForm in Axapta

how to throw the error in the sysqueryform if we are not entering the range value in the prompt dialog by clicking the button.Meanwhile it should not go to another form while clicking and throwing the error.pls help me in this.