|
-
Feb 7th, 2011, 05:05 AM
#1
Thread Starter
New Member
[RESOLVED] Help with forms
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.
-
Feb 7th, 2011, 05:43 AM
#2
Re: Help with forms
Hi... Welcome to the forums...
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
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 7th, 2011, 01:15 PM
#3
Thread Starter
New Member
Re: Help with forms
 Originally Posted by akhileshbc
Hi... Welcome to the forums...
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

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.
-
Feb 7th, 2011, 09:35 PM
#4
Re: Help with forms
I just did a quick testing with the following code and it seems working:
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
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|