RE: application.wait
- From: B. Meincke <garyallan@xxxxxxxxxxxxx>
- Date: Mon, 9 Jun 2008 10:27:04 -0700
Okay, here goes...
Except for the 'application.wait' failing and, without it, the sub
continuing before the archive is complete, the following code seems to work:
Dim fs, f, s
Dim DefPath As String
DefPath = CurrentProject.Path
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
If FileOrDirExists(DefPath & "AttdB_BE.ldb") = True Then
MsgBox "The database is in use, please try again later.", vbOKOnly,
"Sorry..."
mcrQuit
Else
Set f = Nothing
Set fs = Nothing
DefPath = CurrentProject.Path
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
strDate = Format(Now, "yyyy-mm-dd")
sZipFile = DefPath & "BE Backups\AttdB_BE " & strDate & " (before).zip"
sFile = DefPath & "Attdb_BE.mdb"
'Create empty Zip File
NewZip (sZipFile)
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(sZipFile).CopyHere sFile
'Keep script waiting until Compressing is done
On Error Resume Next
Do Until oApp.Namespace(sZipFile).Items.Count = 1
'Application.Wait (Now + TimeValue("0:00:01"))
Loop
Set oApp = Nothing
MsgBox "Run the update scripts...", vbOKOnly, "Simulate:"
End If
End Sub
--
BJM
ACE Assistant
Gary Allan High School
.
- Prev by Date: Re: Open Form with SQL
- Next by Date: RE: Confirm data change on close
- Previous by thread: RE: application.wait
- Next by thread: Re: Set filter
- Index(es):
Relevant Pages
|