Dear All,
I am in quite some trouble. Really need your help. I have defined 3 user controls forms. So each time a user logs in, the user is assigned one user control form. The user control is displayed properly on the main form. there is no issue on that. The problem I have a menu bar with several functions there. Functions like querying a db and displaying data on the user control form. Let's say for user control form1. So on my login form, I have this code below.
Code:
Public _clerkform1 As Clerk1 ParcelSoft.Show() _clerkform1 = New Clerk1 ParcelSoft.Controls.Add(_clerkform1)
So the code above will be for when clerk1 logs in.
Then on my main form, for example I have this code
Code:
Login._clerkform1.DataGridView1.Rows.Clear()
Problem is when clerk 2 is going to log in, it is going to be
Code:
Public _clerkform2 As Clerk2 ParcelSoft.Show() _clerkform2 = New Clerk2 ParcelSoft.Controls.Add(_clerkform2)
But I have already hardcoded _clerkform1 on my main form. Is there any way to switch between instances? Please help.
I am in quite some trouble. Really need your help. I have defined 3 user controls forms. So each time a user logs in, the user is assigned one user control form. The user control is displayed properly on the main form. there is no issue on that. The problem I have a menu bar with several functions there. Functions like querying a db and displaying data on the user control form. Let's say for user control form1. So on my login form, I have this code below.
Code:
Public _clerkform1 As Clerk1 ParcelSoft.Show() _clerkform1 = New Clerk1 ParcelSoft.Controls.Add(_clerkform1)
So the code above will be for when clerk1 logs in.
Then on my main form, for example I have this code
Code:
Login._clerkform1.DataGridView1.Rows.Clear()
Problem is when clerk 2 is going to log in, it is going to be
Code:
Public _clerkform2 As Clerk2 ParcelSoft.Show() _clerkform2 = New Clerk2 ParcelSoft.Controls.Add(_clerkform2)
But I have already hardcoded _clerkform1 on my main form. Is there any way to switch between instances? Please help.