Table Last Modified

P

PC User

I have a table named "tblRoster" and I have a field for each record to
record when each record has been updated; however, I want to display
on the main form, the date that the table "tblRoster" was last
updated. How do I access that date from the MSysObjects table and
display it on my main form?

Thanks,
PC
 
A

Allen Browne

Try a text box with Control Source of:
=[CurrentDb].[TableDefs]("tblRoster").[LastUpdated]

That works in Access 97 and earlier, but I'm not sure if Access maintains
this properly in the versions with the monolithic save (2000 and later).
 
D

Dirk Goldgar

PC User said:
I have a table named "tblRoster" and I have a field for each record to
record when each record has been updated; however, I want to display
on the main form, the date that the table "tblRoster" was last
updated. How do I access that date from the MSysObjects table and
display it on my main form?

Thanks,
PC

Do you want to know when the *design* of tblRoster was changed (as Allen
Browne seems to think) or do you want to know the last date on which any
record in the table was updated? If it's the latter, you wouldn't get
it from MSysObjects, but you can use a text box with a ControlSource
similar to this:

=DMax("YourUpdateDateField", "tblRoster")

You'd have to replace "YourUpdateDateField" with the name of the field
that holds the records' last-update date.
 
P

PC User

Dirk,

That's a good point. Thanks for seeing more into the detail of
the problem. I need the last date that each record in the table was
updated, not the last date that the table structure was updated. I
didn't realize that before. I am now using an unbound field on the
form with a formula in the Control Source.

Code:
=DMax("[LastModified]", "tblRoster")

Thanks,
PC
 
Top