title: Get variable data from one form to another in vb.net
body: <p>I wrote a program to calculate payroll data once an employee enters their information and hours. I am having a problem reading the data from variables in one form to another. What I was trying to do was reading from a form called TimeSheet in my other form called Payroll_Submission. Here is the code I have so far and I really need to get that data from the other form to do my calculations. Please let me know if you need my TimeSheet code, it is long so I didn't attach it this time.</p>
  
  <pre><code>Public Class Payroll_Submission
  
  Private Sub Payroll_Submission_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  
      Dim counter As Integer
      counter = 0
  
      lblEmployee.Text = TimeSheet.EmpName
      lblSuperName.Text = TimeSheet.Supervisor
      lblReport.Text = TimeSheet.Period
  
      If Not TimeSheet.flag Then
          lblHoursWorked.Text = TimeSheet.txtMon1 + TimeSheet.txtTues1 + TimeSheet.txtWed1 + TimeSheet.txtThurs1 + TimeSheet.txtFri1 + TimeSheet.txtSat1 + TimeSheet.txtSun1
          If lblOvertimeHours.Text &gt; 40 Then
              lblRegHours.Text = 40
              lblRegHours.Text = lblHoursWorked.Text - 40
          Else
              lblRegHours.Text = lblHoursWorked.Text
              lblOvertimeHours.Text = 0
          End If
          lblOvertimeHours.Text = "$15"
          lblRateOver.Text = "$22.50"
  
          HourlyPay.Text = Convert.ToInt32(lblRegHours.Text) * 15
          lblOvertimeHours.Text = Convert.ToInt32(lblOvertimeHours.Text) * 22.5
          lblGrossPay.Text = Convert.ToInt32(HourlyPay.Text) + Convert.ToInt32(lblOvertimeHours.Text)
  
          If TimeSheet.chk1.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk2.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk3.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk4.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk5.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk6.Checked Then
              counter = counter + 1
          End If
  
          If TimeSheet.chk7.Checked Then
              counter = counter + 1
          End If
  
          lblPTOHours.Text = counter
  
      End If
  
      HourlyPay.Text = Convert.ToInt32(lblRegHours.Text) * 15
      lblOvertimeHours.Text = Convert.ToInt32(lblOvertimeHours.Text) * 22.5
      lblGrossPay.Text = Convert.ToInt32(lblRegHours.Text) + Convert.ToInt32(lblOvertimeHours.Text)
  End Sub
  </code></pre>
  
  <p>End Class</p>