Results 1 to 4 of 4

Thread: [RESOLVED] Help with forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    5

    Resolved [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.

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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:
    1. '~~~ Form1's code
    2. Private Sub Command1_Click()    '~~~ On clicking a button named "Command1"
    3.     Form2.Label1.Caption = Me.Text1.Text    '~~~ Copy the contents in Form1's Text1 to Form2's Label1
    4.    
    5.     Form2.Show , Me                         '~~~ Show the second form
    6. 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,...

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    5

    Re: Help with forms

    Quote Originally Posted by akhileshbc View Post
    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:
    1. '~~~ Form1's code
    2. Private Sub Command1_Click()    '~~~ On clicking a button named "Command1"
    3.     Form2.Label1.Caption = Me.Text1.Text    '~~~ Copy the contents in Form1's Text1 to Form2's Label1
    4.    
    5.     Form2.Show , Me                         '~~~ Show the second form
    6. 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.

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Help with forms

    I just did a quick testing with the following code and it seems working:
    vb Code:
    1. '~~~ Form1's code
    2. Private Sub Command1_Click()    '~~~ On clicking a button named "Command1"
    3.     Form2.Label1.Caption = Me.Text1.Text    '~~~ Copy the contents in Form1's Text1 to Form2's Label1
    4.    
    5.     Form2.Show                          '~~~ Show the second form
    6.    
    7.     Unload Form1    '~~~ unload the first form
    8. 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
  •  



Click Here to Expand Forum to Full Width