G
Guest
I need some help on setup up a syntax string for finding UserID and Log date
and blank Time field.
Here is my code
Dim rs As DAO.Recordset
Dim strLogDate As Date
Dim strFind As String
strLogDate = Date
strUserId = Me.UserID
strFind = "UserId = '" & strUserId & "'" {need the correct date and null
string added here}
'open login table
Set db = CurrentDb
Set rs = db.OpenRecordset("tblLogIntracking", dbOpenDynaset)
With rs
.MoveLast
'find login record
.FindFirst strFind
If .NoMatch Then
MsgBox "No records found"
Exit Function
Else
MsgBox "Records found"
End If
'add log time
.Edit
!LogOutTime = Time
.Update
End With
rs.Close: Set rs = Nothing
Set db = Nothing
thank you
ih
and blank Time field.
Here is my code
Dim rs As DAO.Recordset
Dim strLogDate As Date
Dim strFind As String
strLogDate = Date
strUserId = Me.UserID
strFind = "UserId = '" & strUserId & "'" {need the correct date and null
string added here}
'open login table
Set db = CurrentDb
Set rs = db.OpenRecordset("tblLogIntracking", dbOpenDynaset)
With rs
.MoveLast
'find login record
.FindFirst strFind
If .NoMatch Then
MsgBox "No records found"
Exit Function
Else
MsgBox "Records found"
End If
'add log time
.Edit
!LogOutTime = Time
.Update
End With
rs.Close: Set rs = Nothing
Set db = Nothing
thank you
ih