Here is the unfinished code for the program. I'm trying to get the dates to format propperly but that's been a problem also.
Option Explicit
'This program will calculate Hours worked, sick or vacation
'and claculate gross pay
Dim curGrossPay As Currency
Dim sngTotalHours As Single
Dim sngOverHours As Single
Dim sngRegHours As Single
Dim sngSickVac As Single
Dim intMinutes As Integer
Dim strFileName As String
Private Sub cmdCalc_Click()
Dim Index As Integer
For Index = 0 To 5
intMinutes = DateDiff("n", txtIn(Index), txtOut(Index))
Next
End
sngTotalHours = intMinutes / 60
If sngTotalHours > 8 Then
sngOverHours = sngTotalHours - 8
Else: sngOverHours = "0"
If sngTotalHours > 8 Then
sngRegHours = sngTotalHours - sngOverHours
Else: sngRegHours = sngTotalHours
End If
End If
curGrossPay = (sngRegHours * 10) + (sngSickVac * 10) + (sngOverHours * (10 * 1.5))
lblRegHours.Caption = Format(sngRegHours, "0.00")
lblOverTime.Caption = Format(sngOverHours, "0.00")
lblGrossPay.Caption = Format(curGrossPay, "currency")
End Sub
Private Sub cmdClear_Click()
lblRegHours.Caption = "0"
lblOverTime.Caption = "0"
lblSickVacation.Caption = "0"
lblGrossPay.Caption = " "
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdVerify_Click()
Const conBtns = vbOKOnly = vbInformation _
+ vbdefaultbutton = vbApplicationModal
Const comMsg1 = "Invalad Employee SSAN reenter."
Dim strSSAN As String
Dim strName As String
End Sub
Private Sub dtmDate_Change()
dtmDate = Format(dtmDate.Text, vbShortDate)
End Sub
Private Sub dtmIn_Change(Index As Integer)
dtmIn(Index) = Format(dtmIn(Index), "Short Time")
End Sub
Private Sub dtmOut_Change(Index As Integer)
dtmOut(Index) = Format(dtmOut(Index), "Short Time")
End Sub
Private Sub Form_Load()
Dim strEmployee(1 To 5) As String
strEmployee(1) = "555-42-9486""Jonah Jones"
strEmployee(2) = "884-34-9999""Mark Smith"
strEmployee(3) = "456-78-9123""John Doe"
strEmployee(4) = "123-45-6789""Red Green"
strEmployee(5) = "741-85-2963""Jim Dipdap"
End Sub
Private Sub txtSick_Change()
sngSickVac = Val(txtSick)
If sngSickVac + sngTotalHours > 8 Then
MsgBox ("Total hours must be less then 8 when employee is taking sick time")
End If
End Sub
Private Sub txtVacation_Change()
sngSickVac = Val(txtVacation)
If sngSickVac + sngTotalHours > 8 Then
MsgBox ("Total hours must be less then 8 when employee is taking vacation time")
End If
End Sub