Hi Guys,
I am wondering the best way to tackle this. I am copying an access file from one location to another ie.
FileCopy "P:\DM.mdb", "P:\DMCopy.mdb"
This works perfectly if the database is closed. If per chance I strike it lucky and someone has it open, then I get an error message.
So, I am trying to do this
'--------------------------------------------------------------
TryAgain:
On Error GoTo HandlerWaitFiveSecs
Application.DisplayAlerts = False
FileCopy "P:\DM.mdb", "P:\DMCopy.mdb"
On Error GoTo 0
'Other code here
HandlerWaitFiveSecs:
Application.Wait Now + TimeValue("0:00:05")
GoTo TryAgain
'--------------------------------------------------------------
The only trouble now is that it loops back after 5 secs and if the db is still open, I then get the same error message.
Any ideas?
Cheers
Phil Spyve
Bookmarks