I'm a little late to the game, but this is how I do it (sort of, mine is much more involved then what I'll explain.)
I have a table that keeps track of the machines my databases run on. So, the first time my db is run on a machine, a form pops up. The form contains at least 4 fields (name of the user (i.e. network id), their phone number, the name and/or ip address of the machine and a new version bit).
Each time the database is opened it checks to see if the new-version bit is set. If it is set, then I call the following batch job, and close (docmd.quit) the database. The batch job will copy the new version to the user's machine and than start the database up again.
Note that to ensure that the user has the latest version of the database, I store the date/time I last modified the database in the properties of the database. I also have another table that defines the project and one of the fields contains the date/time the database was last modified and sent out to the users. Now when the user opens the database, I can check the database property and compare it to the date/time in the project database to ensure they match. If not, then I can assume that the user did not get the new version. (I usually don't bother with this check, but if I feel a need, it's there to do.)
Also note that if the user's database is corrupt, you will not be able to download a new version of the database using this method. However, in 20 years I've been doing this, I have only encountered the problem twice. But, to play it save, place a shortcut on the user's machine that calls a script file. Have the script file check for the new version bit. If the new version bit is set, launch the batch job and exit the script. If the new version bit is not set, then the script should just open the database.
Batch job:
@ECHO on
echo Copying new version of database
echo FROM %1
echo TO %2
echo
echo
copy %1 %2
echo
echo Launching new version of database
%2
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.