Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I show the date of last update ? 1

Status
Not open for further replies.

Lizard

Technical User
Mar 14, 2001
14
0
0
BE
Hello,

I have a DB that is refreshed every day (normally) from a DB2 database. I would like to show to the users the date of the last update. Is it possible to put on a form the "modified" date of a table ? This would indeed reflect the last update.

Thanks

Olivier
 
Access tracks schema update dates but not data update dates. You'll need to create a table to track update data and time. You can then query that table for the last modified date on your form. Terry

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
What about simply getting the file details of the MDB and extracting the 'Date Modified' attribute?

Gary
gwinn7
 
Oliver,

I've had the same problem. I got around it by creating my own property on the table:

Function AddTimestampProperty()
Dim TimeStamp As Property, MYDB As Database
Set MYDB = CurrentDb
Set TimeStamp = MYDB!tblName.CreateProperty("TimeStamp")
TimeStamp.Type = dbDate
TimeStamp.Value = Date
MYDB!tblName.Properties.Append TimeStamp
End Function

This function is run only once. It adds
a user-defined property (TimeStamp) to
any table. This property is used as a
source for the "Last Import into Access"
text box controls on the main menu of
my application.
Note - to re-use, change table name
references below. Run thru Immed Window.

When the import runs, I call this function:

Function UpdateTimeStamp()
'Updates the TimeStamp property of
'tblInventoryEOM with the current system
'date. (See AddTimestampProperty() in this
'module). Called when user imports End
'of Month inventroy data.

Dim MYDB As Database, EOM As TableDef
Set MYDB = CurrentDb
Set EOM = MYDB![tblInventoryEOM]
EOM.Properties!TimeStamp = Now
Set EOM = Nothing
Set MYDB = Nothing

End Function

(Old style punctuation - I wrote it in 2.0)
Hope this helps,
John
 
Oliver,

I forgot this part - on the form load event:

'Populate "Last Import into Access" control
Dim MYDB as Database
Dim COST As TableDef
Set MYDB = CurrentDb
Set COST = MYDB![tblInventoryEOM]
thedate = COST.Properties!TimeStamp
Forms![frmMainMenu]![txtLastLoad]=Format(thedate, "m/d/yy h:nn AM/PM")

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top