Date an Object was last modified - A2k3

T

Tim D

Since Access 2000, the Object.LastUpdated property no longer tells the truth.
For Forms & Reports it simply returns the same as .DateCreated. For TableDefs
and QueryDefs it 'often' returns the date last modified - but not always. I
note that Object.LastUpdated appears to be fetched from
MsysObjects.DateUpdate.

Well known tools like FMS Access Detective simply show the (usually
incorrect) modification date from MsysObjects.

The date of last modification is clearly stored somewhere: the object lists
in the Db Window show the correct date. How can I retrieve this correct date
in Access 2003? (Someone, somewhere must have figured this out?)

T.I.A.
Tim D
 
G

Gary Walter

Tim D said:
Since Access 2000, the Object.LastUpdated property no longer tells the
truth.
For Forms & Reports it simply returns the same as .DateCreated. For
TableDefs
and QueryDefs it 'often' returns the date last modified - but not always.
I
note that Object.LastUpdated appears to be fetched from
MsysObjects.DateUpdate.

Well known tools like FMS Access Detective simply show the (usually
incorrect) modification date from MsysObjects.

The date of last modification is clearly stored somewhere: the object
lists
in the Db Window show the correct date. How can I retrieve this correct
date
in Access 2003? (Someone, somewhere must have figured this out?)
Hi Tim,

It's my understanding that it just plain is not exposed
in the object model and cannot be programmatically
accessed...

http://support.microsoft.com/?kbid=299554

sorry,

gary
 
T

Tim D

Thanks for the response. I am familiar with that KB explanation of why MS
messed it up, and had the same understanding as you. However, in the
meantime, 'Crystal' in the UtterAccess forum pointed out that using
'CurrentProject.AllForms("FormName").DateModified' returns the correct
modifcation date. This seems to work & I am delighted!

Regards
Tim
 
G

Gary Walter

Thanks Tim,

Apparently works for Reports as well...

Public Function fFormLastModified(pFormName As String) As Date
fFormLastModified = CurrentProject.AllForms(pFormName).DateModified
End Function

Public Function fReportLastModified(pReportName As String) As Date
'?fReportLastModified("rptImportErrs")
'8/13/2005 3:52:48 AM <--- correct
fReportLastModified =
CurrentProject.AllReports(pReportName).DateModified
End Function

> Thanks for the response. I am familiar with that KB
explanation of why MS
 
S

Stuart McCall

Tim D said:
'Crystal' in the UtterAccess forum pointed out that using
'CurrentProject.AllForms("FormName").DateModified' returns the correct
modifcation date. This seems to work & I am delighted!

Thanks for mentioning that. I have an immediate use for it.
I am delighted

Just like the lightning bug that reversed into an electric fan, delighted no
end :)
 

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