VBA for backend in server _can we change the source name? can anyone help? (1 Viewer)

hfsitumo2001

Member
Local time
Today, 15:37
Joined
Jan 17, 2021
Messages
365
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?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:37
Joined
Oct 29, 2018
Messages
21,358
Change it to what?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:37
Joined
Feb 19, 2002
Messages
42,976
Relink using the UNC and distribute a new copy of the FE
 

Isaac

Lifelong Learner
Local time
Today, 15:37
Joined
Mar 14, 2017
Messages
8,738
To change the Source name, edit this line.......................
Code:
Source = CurrentDb.Name
 

Users who are viewing this thread

Top Bottom