title: Link Variable to Label on another form in vb
body: <p>I have a small program for some college coursework, i have to enter data of the gender and age of a group of people then work out the male and female percent and the child and adult percent. The bit i am stuck with is i want to display my results on labels on a separate form. Here is my code:</p>
  
  <pre><code>Public Class Form1
  
  Dim TotalGender As Integer
  Dim TotalAge As Integer
  Dim MaleCount As Integer
  Dim FemaleCount As Integer
  Dim ChildCount As Integer
  Dim AdultCount As Integer
  Dim MalePercent As Single
  Dim FemalePercent As Single
  Dim AdultPercent As Single
  Dim ChildPercent As Single
  
  Private Sub btnSub_Click(sender As Object, e As EventArgs) Handles btnSub.Click
  
      If cmbGender.Text = "Male" Then
          MaleCount += 1
  
      End If
  
      If cmbGender.Text = "Female" Then
          FemaleCount += 1
  
      End If
  
      If cmbAge.Text &gt; 18 Then
          ChildCount += 1
  
      End If
  
      If cmbAge.Text &lt;= 18 Then
          AdultCount += 1
      End If
  End Sub
  
  Private Sub btnResults_Click(sender As Object, e As EventArgs) Handles btnResults.Click
  
      Form2.Show()
  
      MalePercent = MaleCount / TotalGender * 100
      FemalePercent = FemaleCount / TotalGender * 100
  
      AdultPercent = AdultCount / TotalAge * 100
      ChildPercent = ChildCount / TotalAge * 100
  
  
  
  
  
  End Sub
  
  Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click
  
  
      TotalGender = 0
      TotalAge = 0
      MaleCount = 0
      FemaleCount = 0
      ChildCount = 0
      AdultCount = 0
      MalePercent = 0
      FemalePercent = 0
      AdultPercent = 0
      ChildPercent = 0
  End Sub
  </code></pre>
  
  <p>End Class</p>
  
  <p>My second form has all the labels already placed and i know how to display results on a label, i just don't know how to transfer the results across to another form</p>