D
DS
I'm trying to compact my backend from my frontend.
I found this code, but am having trouble adapting it.
I'm getting a path error on......Name strOldFile As strNewFile
Me.TxtFile = (Len(Dir$("C:\ProServ\DB\ADatabasebe.ldb")))
If Me.TxtFile>=1 Then
Dim strNewFile As String
Dim strOldFile As String
Dim strOldFileWithoutMDB As String
strNewFile = strOldFileWithoutMDB & Format$(Date, "yyyymmdd") & "
.MDB)"
Name strOldFile As strNewFile
DBEngine.CompactDatabase strNewFile, strOldFile
DoCmd.OpenForm "Form2"
Elseif Me.TxtFile = 0 Then
msgbox "USERS"
End If
Any help is appreciated.
Thanks
DS
I found this code, but am having trouble adapting it.
I'm getting a path error on......Name strOldFile As strNewFile
Me.TxtFile = (Len(Dir$("C:\ProServ\DB\ADatabasebe.ldb")))
If Me.TxtFile>=1 Then
Dim strNewFile As String
Dim strOldFile As String
Dim strOldFileWithoutMDB As String
strNewFile = strOldFileWithoutMDB & Format$(Date, "yyyymmdd") & "
.MDB)"
Name strOldFile As strNewFile
DBEngine.CompactDatabase strNewFile, strOldFile
DoCmd.OpenForm "Form2"
Elseif Me.TxtFile = 0 Then
msgbox "USERS"
End If
Any help is appreciated.
Thanks
DS