I am trying to learn how to use the FileSystemObject methods. I have the following code on a button on a form and I am trying to make it copy a file on click event. I have tried different databases and locations for the sources and destinations but cannot get it to copy. Could someone please steer me in the right direction. I have been reading a book to try and figure this out. I have read through many threads on here as well and have not found anything like what I am having difficulty with. Thank you in advance for your time and knowledge.
Code:
Option Compare Database
Option Explicit
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
Private Sub btnDBCopy_Click()
'Copy current database to local computer
fso.CopyFile "C:\Access 2010 working files\C_GXPS Hydrostatic Library.accdb", "C:\Test\", True
End Sub