How to close the login form after successful login to show the Main form?

I am working in I have a login form and after successfull login I want to close the login form and show the Mdi Main form. But my application exits after the line How should i make the application running after closing the login form.

Thanks in advance.
Who is Participating?
Can we see the code after the success in log-in?

First thing is that your log-in form should be your star-up form.
Secondly, your form should be an independent form and the MDI child is not set to true.

And presumably after the success in log-in you have a code something like this :

if  LogInSuccess = true
    Unload me -> which unload the log-in form itself
   Msgbox "Access Denied"
End If

Get back to me if stil doesnt work. Good luck
Hi vinodjnair,

is the login form your startup form?
and how do you close the login form?
you may better make frmMain your startup form and open login form as the first action.


   You can try with the hide function and not closing

i.e.,  frmLogin.Hide
and then

Hope this helps

hey vinodjinar -

the best way to go is to have your login form seperate from your main form.

have your main form open your login form - in modal mode is best -

then they do the login, or cancel

then you can continue on with a proper login, or close the program if they cancel the log in.

If the continue with proper login, you then just close the login form, and show your main form, then continue on with your process...

Hope this helps...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.