D
DS
I have this function that I'm using to round time with and I'm trying to
Update a record with SQL but the whole thing does nothing....any help
appreciated.
Thanks
DS
Private Sub CommandOne_Click()
Function RoundTime(TimeIn As Date) As Date
Select Case Minute(Forms!frmTimeCardAdjust!TxtTimeIN)
Case 0 To 15
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":15")
Case 16 To 30
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":30")
Case 31 To 45
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":45")
Case Else
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) + 1 & ":00")
End Select
End Function
Dim ONESQL As String
DoCmd.SetWarnings False
ONESQL = "UPDATE tblTimeLog SET tblTimeLog.LogTimeIn = RoundTime " & _
"WHERE tblTimeLog.LogID = Forms!frmTimeCardAdjust!TxtLogID;"
DoCmd.RunSQL (ONESQL)
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmTieAdjustSelect"
End Sub
Update a record with SQL but the whole thing does nothing....any help
appreciated.
Thanks
DS
Private Sub CommandOne_Click()
Function RoundTime(TimeIn As Date) As Date
Select Case Minute(Forms!frmTimeCardAdjust!TxtTimeIN)
Case 0 To 15
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":15")
Case 16 To 30
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":30")
Case 31 To 45
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) & ":45")
Case Else
RoundTime = TimeValue(Hour(Forms!frmTimeCardAdjust!TxtTimeIN) + 1 & ":00")
End Select
End Function
Dim ONESQL As String
DoCmd.SetWarnings False
ONESQL = "UPDATE tblTimeLog SET tblTimeLog.LogTimeIn = RoundTime " & _
"WHERE tblTimeLog.LogID = Forms!frmTimeCardAdjust!TxtLogID;"
DoCmd.RunSQL (ONESQL)
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmTieAdjustSelect"
End Sub