I'm currently creating a multiple form application with a database. My issue is that I need to pass a value from my login form to my project setup form. Currently I am using code to created an instance of Project setup in my login form and sending the value that way, and it appears to work, here is the code:
ProjectSetup ps = new ProjectSetup(userID);
The issue is that after the login form, is the Main Menu. In the Main Menu, I clicked the Project set up button which runs this code:
ProjectSetup obj2 = new ProjectSetup();obj2.Show();
this.Close();
When this happens the instance of ProjectSetup ps is replaced with obj2. Therefor, my value once contained in the ps instance of project setup is now null, since I passed the value to the ps instance and not obj2's instance.
My question is: Is there a way around this?