Access Document's LastUpdated Date is wrong

J

Jim Brownson

My VB code returns incorrect LastUpdated date for reports. Some dates are way
off, some are DateCreated. Tried using VBA in an Access module and tried
upgrading from Access 2000 to 2002/3 format - problem persists. Can you help
or explain ?
 
S

Steve Schapel

Jim,

The LastUpdated property refers to the date of the most recent
modification to the report. This is design changes, and is not related
to when the report is printed or anything of that nature. Is this your
understanding?
 
J

Jim Brownson

Yes, it is my understanding that this date changes only with design changes.
However my VB code ... doc.LastUpdated does not return the same dates
are shown in the database window for that report's property "Modified"
 
S

Steve Schapel

Jim,

Can you please post back with the code you are using, I'll see if we can
replicate the problem behaviour.
 
J

Jim Brownson

Here is my code. Paste it into a module of an Access DB that has one or more
reports. Run the code, observe the dates, make a change to a report, run the
code again and that report's LastUpdated date does not change. Close the DB
and reopen it (if you are concerned about "refresh") ... same bad date. Jim

Private Sub ShowReportDates()
' Print out each report's name, date created and last update date.
Dim doc As Document
Dim cont As Container
For Each cont In CurrentDb.Containers
If cont.Name = "Reports" Then
For Each doc In cont.Documents
Debug.Print "Report Name: " & doc.Name & " Date Created: " &
doc.DateCreated & " Date Created: " & doc.LastUpdated
Next doc
End If
Next cont
End Sub
 
J

Jim Brownson

Steve, Thanks for clarifying this problem. My only disappointment is that my
numerous searches did not hit upon this article. I just tried the following
search in Google: Last Updated Property Returns Incorrect Date. Still no
hit. Previously, I have been extremely impressed with Google's ability to
find answers, even within MS KDB - and when the KDB search failed.

Thanks again.
 
S

Steve Schapel

Jim,

I agree. I also failed to find the article via a MS Knowledge Base
search. I had it pointed out to me by a fellow MVP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top