Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

recordset.LastModified does not seem to work

$
0
0
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

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>