Cancel Form Loading

  • Thread starter Thread starter Vilem Sova
  • Start date Start date
V

Vilem Sova

How can I stop a form from loading within the form-loading event?

I've tried Me.Close and a couple of other variations, but these commands
seem to just get ignored.

Thanks
Vilem Sova
 
Hello,

Vilem Sova said:
How can I stop a form from loading within the
form-loading event?

I've tried Me.Close and a couple of other variations,
but these commands seem to just get ignored.

Throw an exception...

;-)

Regards,
Herfried K. Wagner
 
From my experience, attempting this has been like diving off a cliff, then
trying to stop your dive before you hit the water.
Exit Sub should get you out of the Form_Load sub immediately. Me.Close will
result in destroying the form object, but can only be called after exiting
Form_Load. You should structure your code to decide if the form should be
loaded, before you request the load or show.
 
Back
Top