I have a routine that creates a log entry into a table (that has already been created, is Global and never closed while program running) as certain things are done. I call the following routine before the user starts the particular function so as to create the log entry, then at the end of that particular function, I call the routine and want to add to the previous log entry the words " and finished" that way the log keeps up with the functions starting AND finishing. However, when I try to use the LastModified it always takes me to the first record, not the last added. I know I can use the MoveLast, but it may not be the last entry due to user back dating a system, etc. I even tried capturing the bookmark at the time I create the initial record then trying to return to it but it still takes me to the first record.
Sub CreateLogEntry(Description)
If Description = " and finished." Then
LogRSTable.LastModified
' LogRSTable.Bookmark = ThisBokMrk This does not seem to work either
LogRSTable.Edit
LogRSTable("Action") = LogRSTable("Action") & Description
LogRSTable.Update
Else
LogRSTable.AddNew
LogRSTable("Action") = Left$(Format$(Date, "yyyy/mm/dd") & " " & Format(Time, "hh:mm:ss AM/PM") & " " & Description & " by " & UserName$, 150)
LogRSTable.Update
ThisBokMrk = LogRSTable.Bookmark
End If
End Sub
Sub CreateLogEntry(Description)
If Description = " and finished." Then
LogRSTable.LastModified
' LogRSTable.Bookmark = ThisBokMrk This does not seem to work either
LogRSTable.Edit
LogRSTable("Action") = LogRSTable("Action") & Description
LogRSTable.Update
Else
LogRSTable.AddNew
LogRSTable("Action") = Left$(Format$(Date, "yyyy/mm/dd") & " " & Format(Time, "hh:mm:ss AM/PM") & " " & Description & " by " & UserName$, 150)
LogRSTable.Update
ThisBokMrk = LogRSTable.Bookmark
End If
End Sub