Do not change modified date

D

drice

In Access 2002 or ealier, how do I stop it from changing the modified date
when someone just opens the mdb. Even though they do not change anything, it
still changes the modified date to the same as the accessed date making it
difficult to see which one is the latest version. We have a backup on server
and several people opening it
 
A

Arvin Meyer

drice said:
In Access 2002 or ealier, how do I stop it from changing the modified date
when someone just opens the mdb. Even though they do not change anything, it
still changes the modified date to the same as the accessed date making it
difficult to see which one is the latest version. We have a backup on server
and several people opening it

You can't really change that behavior. What you can do is to create a custom
Version property and update that property when you actually update the
version. Here's some sample code to do that:

Sub CreateVersion()
Dim db As DAO.Database
Set db = CurrentDb
db.Properties.Append db.CreateProperty("AppVersion", dbLong, 123)
Set db = Nothing
End Sub

Sub UpdateVersion()
Dim db As DAO.Database
Set db = CurrentDb
db.Properties("AppVersion").Value = 1
Set db = Nothing
End Sub

Function GetVersion()
Dim db As DAO.Database
Set db = CurrentDb
GetVersion = db.Properties("AppVersion").Value
Set db = Nothing
End Function

Just increase" db.Properties("AppVersion").Value = 1 to 2,3,4,5,6,etc. as
necessary.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
D

Dirk Goldgar

drice said:
In Access 2002 or ealier, how do I stop it from changing the modified
date when someone just opens the mdb. Even though they do not change
anything, it still changes the modified date to the same as the
accessed date making it difficult to see which one is the latest
version. We have a backup on server and several people opening it

I think the only way is to make the file read-only, or else ensure that
they only open it in read-only mode. If this is a backup file, you can
probably make it read-only. But bear in mind that some power user may
get the bright idea of changing the read-only property.

A better approach to versioning may be to use either a table in the
database itself, or a custom database property, to record the version.
I usually use a property.
 
D

drice

Thanks but not really sure how to insert that. The main reason is becasue I'm
using a backup utility which copies the newer file over the older, and if I
open the older one just to look at it, it actually becomes the newer one,
even though it may have older data in it.
 
Top