I'm looking to use the input from one form to output to another. How will I go about doing this? How can I make the second form come to the front after input so that the user is able to view the results?
Thanks for your help.
Printable View
I'm looking to use the input from one form to output to another. How will I go about doing this? How can I make the second form come to the front after input so that the user is able to view the results?
Thanks for your help.
Hi... Welcome to the forums...:wave:
You could access the second form's controls by prefixing the second form's name.
See the below example:
vb Code:
'~~~ Form1's code Private Sub Command1_Click() '~~~ On clicking a button named "Command1" Form2.Label1.Caption = Me.Text1.Text '~~~ Copy the contents in Form1's Text1 to Form2's Label1 Form2.Show , Me '~~~ Show the second form End Sub
:wave:
Thanks for the help man, have implemented it and also adapted it so as to revert from the screen showing output to the input screen. Unfortunately this will not work as the original form is open, I have tried using hide on the original form after using show on the second but it keeps having the same run-time error.
I just did a quick testing with the following code and it seems working:
:wave:vb Code:
'~~~ Form1's code Private Sub Command1_Click() '~~~ On clicking a button named "Command1" Form2.Label1.Caption = Me.Text1.Text '~~~ Copy the contents in Form1's Text1 to Form2's Label1 Form2.Show '~~~ Show the second form Unload Form1 '~~~ unload the first form End Sub