How can I stop a form from being loaded?

  • Thread starter Thread starter Joecx
  • Start date Start date
J

Joecx

Hi
Does anyone know how to stop a form from being loaded while in the load
routine. I am wanting to stop the load and go back to the form that called it
if a file does not exist at that exact moment in time. Due to timing, I can't
check for the file to exist on the previous form because someone else may be
using it by the time the new form is loaded, so I am trying to get out of the
load and go back to the form that called it. No matter what I try, it still
finishes the load. Exit sub doesn't even get out.........nor does performclick
on a button that will load another form. Those things just don't seem to work
while in the Load part of the program. Any help will be appreciated.
 
Joecx,
Throw an exception.

In the form that called this form, be certain to enclose the loading of the
second form in a try/catch block.

Hope this helps
Jay
 
Back
Top