Cancel Form Loading

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
 
H

Herfried K. Wagner

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
 
R

RJ

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.
 

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

Top