I am trying to retrieve the LastUpdated date from Access objects and sometimes it is returning the DateCreated value.
I am seeing the same results querying MSysObjects:
SELECT MSysObjects.Name,
Switch([Type]=5,'Query',[Type]=-32768,'Form',[Type]=-32764,'Report',[Type]=-32766,'Macro',[Type]=-32761,'Module') AS ObjectType,
MSysObjects.DateUpdate
FROM MSysObjects
WHERE (((Left$([Name],1))<>'~') AND ((MSysObjects.Type) In (5,-32768,-32764,-32766,-32761)))
ORDER BY MSysObjects.DateUpdate DESC;
or using DAO from the Immediate window:
? CurrentDb.Containers("Forms").Documents("frm_POC_Assignment_Override").LastUpdated
The correct date is shown in the Navigation Pane (if you select View By | Details)
and appears in the object properties dialog:
I am using Access 2016 Office 365, 32-bit.
well just another minor comment to this topic. Access is a good multi user application, but isn't really striving to be a multi-developer management studio.... which is the only reason you would need to time stamp fixed objects design changes.
in most cases one definitely does not want users changing objects - and the compiled .accde is all that is released, so they do not have that ability.
where the user base has the skills to craft their own queries - it often is best to set up a separate front end specifically for this purpose and keep them out of the main application's object navigation pane.
In doing research while writing up this question I found out that this is a known bug from a long time ago (at least Access 2007).
KB 299554: The Data Access Objects (DAO) LastUpdated property returns incorrect dates/times in Microsoft Access database
While it's disappointing that Microsoft hasn't fixed it, there is another way to get the accurate information.
Here is a function that will retrieve the correct information (except for modules):
If you want to call this function in SQL I suggest that you filter before selecting all objects or it will be slow.