LastModified property in Reports

M

Mav-Man

I run following code:

Dim db As DAO.Database
Dim docLoop As Document
Dim prpLoop As Property
Dim i As Integer
Dim pcnt As Integer
Set db = CurrentDb

Dim rstRep As ADODB.Recordset
Set rstRep = New ADODB.Recordset
rstRep.Open "xxReports", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic

db.Containers("Reports").Documents.Refresh

With db.Containers!Reports
For Each docLoop In .Documents
'If docLoop.Properties(7) >= #8/28/2003# Then

rstRep.AddNew
rstRep("ReportName") =
docLoop.Properties(0)
rstRep("DateCreated") =
docLoop.Properties(6)
rstRep("DateModified") =
docLoop.Properties(7)
'rstRep("Description") =
docLoop.Properties(10)
rstRep.Update

'End If
Next docLoop
End With

rstRep.Close
Set rstRep = Nothing

db.Close
Set db = Nothing
ehandler:
If Err = 3265 Then Resume Next


Only to discover that the "LastModified" date is not
always the same as what the Database window shows.

rptLeaveReport, in the Database window says the
LastModified date was 08/29/2003 ... but run the code and
it says the LastModified date is 05-13-2002!

What's up with this. Tried Compact and Repair ... same
result. Database window still says 08/29/2003
but .Documents!Reports says 05-13-2002.

Furthermore, can't find the "Description" property. You
know, you type a description of the Report. When I
enumerate through the properties, I get (0) thru
(7). "Description" is NOT one of them.

I'm documenting a database. I'd like to drop the Report
Names and the "Description" into a table, but can't find
the "Description" property. (7) is "LastModified" ... (0)
is "Name" ... where is "Description"????
 
D

Dirk Goldgar

Graham Mandeno said:
Hi Mav-Man

Firstly, you cannot (since Access 2000) rely on created/modified
dates any more, either in the document properties or in the database
window. AFAIK, the DateCreated and LastUpdated document properties
for forms and reports always have the same value, the date/time that
the object was created. The dates in the database window can get
changed by a number of different occurrences - notably, a
Compact/Repair will set them all to Now(). I'm afraid I don't know
of ANY way to reliably ascertain the created/modified dates of most
database objects. I believe it can't be done, although I would love
to be corrected.

I'm not sure this is a correction, Graham, but in my copy of Access
2002, compacting doesn't *seem* to change the dates as displayed in the
database window. And the new AccessObject properties DateCreated and
DateModified -- as in Debug.Print
CurrentProject.AllForms("MyForm").DateModified -- appear to be correct.
I haven't tested this thoroughly because I was primarily using A2K until
a couple of days ago, but maybe they've fixed this problem in A2K2.
 

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