W
Winshent
My code below is called by auto exec and copies the file from the
shared drive to a users local drive. All works fine in mdb mode, but i
cannot compact the mdb and cannot convert to mde. It will only
compact/convert if i rem the code out..
Is there a solution to this? I'm using Access 2003.
##############################################################
Sub CopyToLocal
Const q As String * 1 = """"
Dim DestPath As String
Dim SourcePath As String
Dim strUpdateTool As String
DestPath = DLookup("[DestinationPath]", "tblConfig")
If CurrentProject.Path <> DestPath Then
If FileExists(DestPath) & CurrentProject.Name) Then
DeleteFile (DestPath & CurrentProject.Name)
end if
If Not FolderExists(DestPath) Then
CreateFolder (DestPath)
end if
CopyFile CurrentProject.Path, DestPath, CurrentProject.Name
strUpdateTool = "MSAccess.exe " & q & DestPath & CurrentProject.Name
& q
Shell strUpdateTool, vbNormalFocus
End Sub
##############################################################
shared drive to a users local drive. All works fine in mdb mode, but i
cannot compact the mdb and cannot convert to mde. It will only
compact/convert if i rem the code out..
Is there a solution to this? I'm using Access 2003.
##############################################################
Sub CopyToLocal
Const q As String * 1 = """"
Dim DestPath As String
Dim SourcePath As String
Dim strUpdateTool As String
DestPath = DLookup("[DestinationPath]", "tblConfig")
If CurrentProject.Path <> DestPath Then
If FileExists(DestPath) & CurrentProject.Name) Then
DeleteFile (DestPath & CurrentProject.Name)
end if
If Not FolderExists(DestPath) Then
CreateFolder (DestPath)
end if
CopyFile CurrentProject.Path, DestPath, CurrentProject.Name
strUpdateTool = "MSAccess.exe " & q & DestPath & CurrentProject.Name
& q
Shell strUpdateTool, vbNormalFocus
End Sub
##############################################################