Need to know if I could use the following code to copy a CSV file to TXT. In other words can I use the code and change the extension. The reason that I'm asking is that once the extension is change I would like to uploaded to access. Suggestion and best practices will be appreciated.
Luis
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Function xCopyITPMODatabase()
Dim strSourceFile As String
Dim strDestinationPath As String
On Error GoTo CopyIT_Exit
' Set the target file path
strSourceFile = "\\ftwss04\is&t_proj_rw\PMO_Public\PublicDashboard.mde"
' Set the target file path
strDestinationPath = "\\ftwgroups\jsf\jsfitcoord\acWKspace\F-35 Dash Board\"
' Check that the source file exists
If Dir(strSourceFile) = vbNullString Then
'The Source File does not exist
GoTo CopyIT_Exit
End If
' Check that the destination folder exists.
If Dir(strDestinationPath) = vbNullString Then
MkDir (strDestinationPath)
End If
' Delete the Destination file if it already exists
strDestinationPath = strDestinationPath & "PublicDashboard.mde"
If Dir(strDestinationPath) <> vbNullString Then
Kill strDestinationPath
End If
'Copy the file
FileCopy strSourceFile, strDestinationPath
CopyIT_Exit:
Const cTIME = 1000 'in MilliSeconds
Call sSleep(cTIME)
DoCmd.Quit
End Function
Luis
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Function xCopyITPMODatabase()
Dim strSourceFile As String
Dim strDestinationPath As String
On Error GoTo CopyIT_Exit
' Set the target file path
strSourceFile = "\\ftwss04\is&t_proj_rw\PMO_Public\PublicDashboard.mde"
' Set the target file path
strDestinationPath = "\\ftwgroups\jsf\jsfitcoord\acWKspace\F-35 Dash Board\"
' Check that the source file exists
If Dir(strSourceFile) = vbNullString Then
'The Source File does not exist
GoTo CopyIT_Exit
End If
' Check that the destination folder exists.
If Dir(strDestinationPath) = vbNullString Then
MkDir (strDestinationPath)
End If
' Delete the Destination file if it already exists
strDestinationPath = strDestinationPath & "PublicDashboard.mde"
If Dir(strDestinationPath) <> vbNullString Then
Kill strDestinationPath
End If
'Copy the file
FileCopy strSourceFile, strDestinationPath
CopyIT_Exit:
Const cTIME = 1000 'in MilliSeconds
Call sSleep(cTIME)
DoCmd.Quit
End Function