frmMIS.UserName.Text is defaulted to 'sa'
I change it to 'sa1' when logged in as admin.
I hit btnApply.
I want frmMISRoutine.UserName.Text to become 'sa1' immediatly.
I do not want to show the form immediately.
I hit btnRoutines and load frmMISRoutine screen.
I want to see frmMISRoutine.UserName.Text as 'sa1'
How the hell can I do it...my code is below:
I don't mind learning how to write classes/modules but shouldn't this be a
simple enough thing to do. I still think that it is not much use beeing able
to share objects between screens if you have to load that screen straight
away. It doesn't seem very dynamis, what if you wanted to update the value on
4 screens, would you have to show them all?
UserName.Text on both forms is defaulted to 'sa'
' Apply button to set Routines.UserName.Text from 'sa' to 'sa1'
Private Sub btnApply_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnApply.Click
Dim frmMISRoutine As New Routines
frmMISRoutine.UserName.Text = Me.UserName.Text
Me.ClientSize = New System.Drawing.Size(584, 435)
pnlProperties.Visible = False
btnProperties.Enabled = True
btnApply.Visible = False
btnCancel.Visible = False
sbMIS.Text = "Use buttons to navigate the application (e.g.) [Properties
sets the database and log parameters]."
PollDirectory = txtPollDirectory.Text
End Sub
' Open Routines Form. the UserName.Text should be 'sa1'.
Private Sub btnRoutines_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnRoutines.Click
Dim frmMISRoutine As New Routines
frmMISRoutine.Show()
Me.Close()
' When this loads Routines UserName is still sa aaarrrrgggghhhhhh!!!
End Sub