kimprogrammer
Programmer
Hello
I'm trying to teach myself VB.net 2005 and am having a problem with an error.
I'm trying to create a payroll timesheet. I want the user to select the payperiod from a combobox. The payperiod is part of a file and another field on is called PPLock which is a bit(boolean) field. If the user selects a payperiod that is locked I don't want them to proceed.
My problem is that I get the message PPLock is not defined, but when I put in (ByVal PPlock as Boolean) I recieve an error pointing at SelectedIndexChanged of Handles cboPPStart.SelectedIndexChanged saying they are not the same signature.
So I'm not sure what to do.
Here is my code
-------------------------------------
'
'selects payperiod start date
'
Private Sub cboPPStart_SelectedIndexChanged(ByVal PPlock As Boolean, ByVal sender As Object, ByVal e As System.EventArgs) Handles cboPPStart.SelectedIndexChanged
Create_Panels_And_Contols()
'checks if payperiod has been locked
Debug.WriteLine(PPLock)
If PPLock = True Then
MsgBox("Payroll has been started. Please contact Payroll Department if you have any changes", vbOKOnly)
End If
'calculate and display the payperiod end date
Dim TempDate As Date = CType(cboPPStart.Text, Date)
TempDate = TempDate.AddDays(14)
lblPPEndDate.Text = TempDate.ToString("d")
End Sub
---------------------------------------
Private Sub Timesheet_Entry_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Create_Panels_And_Contols()
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10100' table. You can move, or remove it, as needed.
Me.CPY10100TableAdapter.Fill(Me.HYLTDDataSet.CPY10100)
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10020' table. You can move, or remove it, as needed.
Me.CPY10020TableAdapter.Fill(Me.HYLTDDataSet.CPY10020)
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10050' table. You can move, or remove it, as needed.
Me.CPY10050TableAdapter.Fill(Me.HYLTDDataSet.CPY10050)
'TODO: This line of code loads data into the '_keyscan_payrollDataSet.PPStartDate' table. You can move, or remove it, as needed.
Me.PPStartDateTableAdapter.Fill(Me._keyscan_payrollDataSet.PPStartDate)
Dim PPStartDate As New _keyscan_payrollDataSet()
'open the Supervisor Table
Me.Refresh()
End Sub
----------------------------------------------
Thank you for your help
I'm trying to teach myself VB.net 2005 and am having a problem with an error.
I'm trying to create a payroll timesheet. I want the user to select the payperiod from a combobox. The payperiod is part of a file and another field on is called PPLock which is a bit(boolean) field. If the user selects a payperiod that is locked I don't want them to proceed.
My problem is that I get the message PPLock is not defined, but when I put in (ByVal PPlock as Boolean) I recieve an error pointing at SelectedIndexChanged of Handles cboPPStart.SelectedIndexChanged saying they are not the same signature.
So I'm not sure what to do.
Here is my code
-------------------------------------
'
'selects payperiod start date
'
Private Sub cboPPStart_SelectedIndexChanged(ByVal PPlock As Boolean, ByVal sender As Object, ByVal e As System.EventArgs) Handles cboPPStart.SelectedIndexChanged
Create_Panels_And_Contols()
'checks if payperiod has been locked
Debug.WriteLine(PPLock)
If PPLock = True Then
MsgBox("Payroll has been started. Please contact Payroll Department if you have any changes", vbOKOnly)
End If
'calculate and display the payperiod end date
Dim TempDate As Date = CType(cboPPStart.Text, Date)
TempDate = TempDate.AddDays(14)
lblPPEndDate.Text = TempDate.ToString("d")
End Sub
---------------------------------------
Private Sub Timesheet_Entry_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Create_Panels_And_Contols()
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10100' table. You can move, or remove it, as needed.
Me.CPY10100TableAdapter.Fill(Me.HYLTDDataSet.CPY10100)
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10020' table. You can move, or remove it, as needed.
Me.CPY10020TableAdapter.Fill(Me.HYLTDDataSet.CPY10020)
'TODO: This line of code loads data into the 'HYLTDDataSet.CPY10050' table. You can move, or remove it, as needed.
Me.CPY10050TableAdapter.Fill(Me.HYLTDDataSet.CPY10050)
'TODO: This line of code loads data into the '_keyscan_payrollDataSet.PPStartDate' table. You can move, or remove it, as needed.
Me.PPStartDateTableAdapter.Fill(Me._keyscan_payrollDataSet.PPStartDate)
Dim PPStartDate As New _keyscan_payrollDataSet()
'open the Supervisor Table
Me.Refresh()
End Sub
----------------------------------------------
Thank you for your help