Hi all,
I am trying to move files from one folder to another with my program. How I am doing it is the user clicks the file in the file list box and then clicks Copy, then clicks a folder name in a listbox. But it gives me the error "Path/File Access Error"
Here is my code
VB Code:
Private Sub cmdCopyTo_Click() If File1.ListIndex < 0 Then MsgBox "No Selected Songs.", vbCritical Exit Sub End If sFileName = File1.Path If Right$(sFileName, 1) <> "\" Then sFileName = sFileName & "\" End If sFileName = sFileName & File1.Filename MsgBox "Select Folder to send files to.", vbInformation blnCopy = True End Sub Private Sub lstSetupAr_Click() Dim dir As String If blnCopy Then lstSetupDire.ListIndex = lstSetupAr.ListIndex [COLOR=Red]FileCopy sFileName, lstSetupDire.Text[/COLOR] 'Error Line blnCopy = False Exit Sub End If End Sub




Reply With Quote