hey,
i have a punch clock that users punch in and out
they can punch in twice and punch out twice
when i update and try to calculate the total hours
it updates only 2 fields [EnterIN] [EnterOut]
instead of [EnterIN] [EnterOut] [EnterIN1] [EnterOut2] why?
i know that the update is ok i dont get any errors at all
this is my code
tnx for any helpCode:Dim Rs As New ADODB.Recordset Rs.Open "Select * From EnterWork where EnterName='" & RplS(CmbName.Text) & "' AND EnterDate = #" & StrDate & "#", CN If Not IsNull(Rs!EnterIN1) Then StrSql = "UPDATE Enterwork SET " StrSql = StrSql & "EnterOut2 = '" & RplS(LblTheTime.Caption) & "'," StrSql = StrSql & "EnterRemarks = '" & RplS(TxtRemarks.Text) & "'" StrSql = StrSql & " WHERE EnterID = " & Rs!EnterID CN.Execute StrSql Dim TimeDiff As Long Dim StartDate As Date Dim EndDate As Date EndDate = Time TimeDiff = DateDiff("n", StartDate, EndDate) CN.Execute "Update Enterwork SET [EnterTotal]=DateDiff(""n"", [EnterIn],[EnterOut],[EnterIN1],[EnterOut2]) WHERE [EnterID]= " & Rs!EnterID Rs.Close Unload Me Exit Sub End If Rs.Close
salsa 31![]()




Reply With Quote