VBA for backend in server _can we change the source name? can anyone help?

hfsitumo2001

Member
Local time
Today, 09:27
Joined
Jan 17, 2021
Messages
394
Code:
Option Compare Database
Public Function SimpleLogin_A_R1() As Boolean
Dim Source As String
Dim Target As String
Dim objFSO As Object
Dim Path As String

Source = CurrentDb.Name
'Path = CurrentProject.Path
Path = "C:\TestDB"
Target = Path & "\BackupDB_" & Format(Now(), "mm-dd-yyyy") & ".accdb"

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.folderExists(Path) Then
    a = objFSO.copyfile(Source, Target, True)
Else
    objFSO.Createfolder (Path)
    a = objFSO.copyfile(Source, Target, True)
End If
Set objFSO = Nothing
Set a = Nothing

End Function

can we change the source name? can anyone help?
 
Relink using the UNC and distribute a new copy of the FE
 
To change the Source name, edit this line.......................
Code:
Source = CurrentDb.Name
 

Users who are viewing this thread

Back
Top Bottom