businesshippieRH
Registered User.
- Local time
- Today, 16:19
- Joined
- Aug 8, 2014
- Messages
- 60
I haven't used FSO before, and it seems that the syntax is a little different than typical VBA for strings, but I can't quite figure out what I'm doing wrong here... I keep getting a "file not found" error on the "FSO.CopyFile..." line. I have printed all of my strings to the immediate window to check that they're printing correctly. It all looks good. My code is as follows:
Thanks in advance!
Code:
'Copy file
'Set up strings for coding file names
Dim FilePath As String
FilePath = Me.txt_FilePath
Dim FileName As String
FileName = Me.txt_FileName
Dim FullPath As String
FullPath = FilePath & FileName
Dim NewTitle As String
NewTitle = Me.txt_Title
Dim RecFile As String
RecFile = "T:\DATABASE\RecordsDB\Records\"
'Set up FSO declarations
Dim FSO As Scripting.FileSystemObject
Set GetFSO = CreateObject("Scripting.FileSystemObject")
Set FSO = GetFSO
If FSO Is Nothing Then 'Error handling procedure
Exit Sub
End If
'Copy File
FSO.CopyFile "'FullPath'", RecFile & "'FileName'", False
'Rename File to Record Name
Name "RecFile & 'FileName'" As "RecFile & 'NewTitle'"
Thanks in advance!