PC Review


Reply
Thread Tools Rate Thread

Display Database Modified Date on form

 
 
Zoe
Guest
Posts: n/a
 
      8th Jan 2008
I would like to display the date that the database was last modified on a form.
I found a message in the newsgroup (I can't seem to find it again) that
suggested this code:

Dim fs As Object
Dim f As Object
Dim strModDate As String

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(CurrentProject.FullName)
strModDate = f.DateLastModified
Debug.Print strModDate
Set f = Nothing
Set fs = Nothing

However, I need a little more direction. Can someone please provide some
basic assistance? I'm assuming that the code is assigned to an event on the
label, but I'm not sure if this is correct or what event to use. Also, do I
modify the CurrentProject.FullName? If so, to what?

Thanks!
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      8th Jan 2008
On Tue, 8 Jan 2008 11:36:06 -0800, Zoe <(E-Mail Removed)> wrote:

>I would like to display the date that the database was last modified on a form.


I don't know any good way to do that without writing a WHOLE lot of code. The
Windows "modified" date gets changed whenever a database is opened, whether or
not you make any design changes to any of the objects or update any tables.

Do you want to track when the *structure* of the database was modified, or the
*values* in one or more tables changed?

John W. Vinson [MVP]
 
Reply With Quote
 
Zoe
Guest
Posts: n/a
 
      8th Jan 2008
Thanks for the quick reply. The writing of a whole lot of code sounds very
dismal to me.

Here is my process. I have a database that is maintained in one location.
The data in the underlying tables is added, deleted or modified within this
location. The file is shared out to multiple locations on a nightly basis.
The users at those locations do not modify the data at all, they are reading
it from another application.

My thought was to use the modifed date as an indicator if we needed to
verify that the locations had the most current version (e.g. does the modifed
date in the lacation match the modified date in the main location). But if
the modifed date changes when the database is opened, it won't be correct.

I have considered storing a user generated version number when the database
is updated by the main location - unless you have any further thoughts. I
thank you for your time!

"John W. Vinson" wrote:

> On Tue, 8 Jan 2008 11:36:06 -0800, Zoe <(E-Mail Removed)> wrote:
>
> >I would like to display the date that the database was last modified on a form.

>
> I don't know any good way to do that without writing a WHOLE lot of code. The
> Windows "modified" date gets changed whenever a database is opened, whether or
> not you make any design changes to any of the objects or update any tables.
>
> Do you want to track when the *structure* of the database was modified, or the
> *values* in one or more tables changed?
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      9th Jan 2008
On Tue, 8 Jan 2008 13:57:02 -0800, Zoe <(E-Mail Removed)> wrote:

>I have considered storing a user generated version number when the database
>is updated by the main location - unless you have any further thoughts. I
>thank you for your time!


That's almost surely your best bet. Just have a little one-record, one-field
table with a Date/Time field WhenModified. As part of the code that makes the
database available to the users, set it to Now().

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display a Date when a cell is Modified Sean Microsoft Excel Worksheet Functions 2 15th Jul 2008 09:16 PM
Display Date Modified =?Utf-8?B?ZGViYmllZXZhbnM=?= Microsoft Excel Misc 5 12th Feb 2007 01:20 PM
Display date modified =?Utf-8?B?Q3VyaW91cw==?= Microsoft Excel Misc 2 13th Jul 2006 12:34 PM
Display Date Modified Rich P Microsoft Excel Misc 0 25th May 2006 04:32 PM
How do I display Modified date DavPet Microsoft Access Forms 6 6th Oct 2005 02:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 PM.