How can i stop the loading of a form in On Load?

How can i stop the loading of a form in On Load?

Hi,

I have a statement in a form's OnLoad event and if the condition is met I want to give an alert message and just exit the form. I don't want to load the form further. 

e.g. of statement I am using

if ( value1 =  wrongValue )
{
    alert(("You are not allowed to access this report. Thanks"));
      // Here I want a statement so that form can't be loaded and no fields are shown. I don't want to hide
      // any controls.
}


Looking forward to it.

Thanks
Manpreet