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:
  1. Private Sub cmdCopyTo_Click()
  2.     If File1.ListIndex < 0 Then
  3.         MsgBox "No Selected Songs.", vbCritical
  4.         Exit Sub
  5.     End If
  6.     sFileName = File1.Path
  7.     If Right$(sFileName, 1) <> "\" Then
  8.         sFileName = sFileName & "\"
  9.     End If
  10.     sFileName = sFileName & File1.Filename
  11.     MsgBox "Select Folder to send files to.", vbInformation
  12.     blnCopy = True
  13. End Sub
  14.  
  15. Private Sub lstSetupAr_Click()
  16.     Dim dir As String
  17.     If blnCopy Then
  18.         lstSetupDire.ListIndex = lstSetupAr.ListIndex
  19.         [COLOR=Red]FileCopy sFileName, lstSetupDire.Text[/COLOR] 'Error Line
  20.         blnCopy = False
  21.         Exit Sub
  22.     End If
  23. End Sub