Hello All,
I have the following code:
techid = Forms!Main!txtCurrentUserID
Task = 2
note = "Work Instructions"
strSQL = "SELECT *"
strSQL = strSQL & "FROM [tblTracking] "
strSQL = strSQL & "WHERE ([EmpID]=" & techid & ");"
Set rs = CurrentDb.OpenRecordset(strSQL)
With rs
.MoveLast
If !endtime = "" Or IsNull(!endtime) Then
.Edit
!endtime = Time
.Update
End If
End With
For whatever reason, this code will move to the last record that was entered in YESTERDAY, but I want it to move to the last record that was entered in TODAY. If I change the code to only records that are dated today, it claims there are no records (EOF), when there clearly are. I am not sure why the code will not move to the last record of the table, it is only moving to the last record that was entered yesterday, any advice? Thank you!:banghead:
I have the following code:
techid = Forms!Main!txtCurrentUserID
Task = 2
note = "Work Instructions"
strSQL = "SELECT *"
strSQL = strSQL & "FROM [tblTracking] "
strSQL = strSQL & "WHERE ([EmpID]=" & techid & ");"
Set rs = CurrentDb.OpenRecordset(strSQL)
With rs
.MoveLast
If !endtime = "" Or IsNull(!endtime) Then
.Edit
!endtime = Time
.Update
End If
End With
For whatever reason, this code will move to the last record that was entered in YESTERDAY, but I want it to move to the last record that was entered in TODAY. If I change the code to only records that are dated today, it claims there are no records (EOF), when there clearly are. I am not sure why the code will not move to the last record of the table, it is only moving to the last record that was entered yesterday, any advice? Thank you!:banghead: