Hi All,
New to programming just writing my first application.
Basically during the form load event i carry out some checks to make sure i have database connection and a valid login, if these items fail i catch the exception and display a messagebox and change a boolean variable to false.
It then goes back to form load where i have an if statement which is if boolean variable = false then me.close
Trouble is this runs through to the conclusion of the form_load sub and then attempts to load and throws an instance of an object type exception.
I kinda understand the logic that i am trying to close the form before it has loaded, so put the close command in the form_activated routine, however this still eventually sends me back to the form load sub and tries to load the form, and then throws the same exception.
Can someone advise where i am going wrong? and how to rectify.
Thanks
Stuart
New to programming just writing my first application.
Basically during the form load event i carry out some checks to make sure i have database connection and a valid login, if these items fail i catch the exception and display a messagebox and change a boolean variable to false.
It then goes back to form load where i have an if statement which is if boolean variable = false then me.close
Trouble is this runs through to the conclusion of the form_load sub and then attempts to load and throws an instance of an object type exception.
I kinda understand the logic that i am trying to close the form before it has loaded, so put the close command in the form_activated routine, however this still eventually sends me back to the form load sub and tries to load the form, and then throws the same exception.
Can someone advise where i am going wrong? and how to rectify.
Thanks
Stuart