If you're building a Windows Forms app then note that when the main window closes the app terminates. The main window is the first form that is opened. It sounds like you initially created the transaction window and then added the login form. But the app sees the main window as the first form you had (transaction). Go to your app's startup code (or search for where your transaction window class is used). Somewhere is a call to create and display that form and it is probably being passed to Application.Run
. Change it to create an instance of your login form instead.
To prevent the app from closing when the login form goes away (the startup window) you'll need to adjust the behavior. VB actually has better support for this through its custom application class. Set the ShutdownStyle to only close after all forms are closed. If you're not using that base class for some reason then you can implement the equivalent logic as discussed here.