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
 
Hello,

Joecx said:
Does anyone know how to stop a form from being loaded
while in the load routine.

Just throw an exception...

;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top