hi ya,
I'm trying to create a program which is a sort of a payslip. It calculates the hours that the staff works, including overtime. The details have to be read from a .txt file. I have managed to create that file and make it so that it appears in vb6. BUt i'm havin problems calculating the total hours worked, overtime etc. (overtime is calculated if the hours worked is over 40)
below is the code to open file and display on vb6.
CODE
Private Sub cmdDisplay_Click()
Dim strEmpFileName As String
Dim strBackSlash As String
Dim intEmpFileNbr As Integer
Dim strEmpName As String
Dim intDeptNbr As Integer
Dim strJobTitle As String
Dim dtmHireDate As Date
Dim HrsWorked As Single
Dim sngHrlyRate As Single
strBackSlash = IIf(Right$(App.Path, 1) = "\", "", "\")
strEmpFileName = App.Path & strBackSlash & "EMPLOYEE.DAT"
intEmpFileNbr = FreeFile
Open strEmpFileName For Input As #intEmpFileNbr
Do Until EOF(intEmpFileNbr)
Input #intEmpFileNbr, strEmpName, intDeptNbr, strJobTitle, dtmHireDate, sngHrlyRate, HrsWorked
Print strEmpName; _
Tab(25); Format$(intDeptNbr, "@@@@"); _
Tab(35); strJobTitle; _
Tab(55); Format$(dtmHireDate, "mm/dd/yyyy"); _
Tab(70); Format$(Format$(sngHrlyRate, "Standard"), "@@@@@@@"); _
Tab(80); Format$(Format$(HrsWorked, "Standard"), "@@@@@@@")
Loop
Close #intEmpFileNbr
End Sub
Help me please
Thank you x
The EMPLOYEE.dat file shows"ANDY ANDERSON",100,"PROGRAMMER",#3/4/1997#,9.5, 40
"BILLY BABCOCK",110,"SYSTEMS ANALYST",#2/16/1996#,10,44
"CHARLIE CHEESEMAN",100,"COMPUTER OPERATOR",#3/1/1996#,7.5,38
"DARLENE DUNCAN",200,"RECEPTIONIST",#10/11/1998#,8.9,45.5
"ERNIE EACHUS",300,"MAIL ROOM CLERK",#8/19/1997#,7.9,20