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

Posted on 2004-04-19
Last Modified: 2008-03-06

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.
Question by:vinodjnair

Expert Comment

ID: 10858268
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.


Expert Comment

ID: 10858345

   You can try with the hide function and not closing

i.e.,  frmLogin.Hide
and then

Hope this helps


Expert Comment

ID: 10863805
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...


Accepted Solution

Phoenixric earned 30 total points
ID: 10925785
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ClickOnce Install - Shortcut Question 3 73
groupSum6 challenge 6 77
groupSumClump challenge 9 103
allswap challenge 6 80
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now