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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Closing access Database

Status
Not open for further replies.

darinmc

Technical User
Feb 27, 2005
171
GB
Hi
I have some simple code 'FileCopy' which i would like to use when closing the database.
I'm not sure where to put it AND whether it would work as you cant copy a file if this is already open.

My users are using an MDE database on a server. I'm continuously updating the file therefore, when a user quits the MDE, I would use code DlookUp to check a version number on the switchboard (OnClose or OnUnload), IF its different, then I would like to copy it from Server to local C:

HOWEVER, the filecopy will cause an error if the MDE is open!!!
PLUS
I dont know where to put the code?

Code:
Dim SourceFile, DestinationFile
SourceFile = "\\LynxServer\Lynx\LynxFormsServerVersionMDE.mde"    'Define source file name.
DestinationFile = "C:\Lynx\LynxFormsServerVersionMDE.mde"    ' Define target file name.
FileCopy SourceFile, DestinationFile    ' Copy source to target.

If there is a better suggestion, please HeLp

Thx
Darin
 
Many/most of us use some sort of utility that does this on startup. There are any number of ways to do it, but here's one:


I use a front end table with version history, and an exe that checks the version on the server against the version on the PC, copying the new version if necessary. Then it starts the program.

Paul
MS Access MVP 2007/2008
 
Thanks will give it a go...
was thinking of a different solution

Could anyone help with this one,

Code:
Dim appAccess As New Access.Application
appAccess.OpenCurrentDatabase ("C:\Lynx\Test1.mde")

when it opens the new database, the window is NOT fullscreen, is it possible to do this??

Thx
Darin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top