Ms access MS Access多文件副本

Ms access MS Access多文件副本,ms-access,vba,Ms Access,Vba,下面是我的代码。基本上,它会提示用户选择文件并将其复制到目标。但是,我将AllowMultiSelect设置为True,但代码只复制用户选择的第一个文件,而忽略任何其他文件。我错过了什么 With fDialog ' Allow user to make multiple selections in dialog box ' .AllowMultiSelect = True ' Set the title of the dialog box. '

下面是我的代码。基本上,它会提示用户选择文件并将其复制到目标。但是,我将AllowMultiSelect设置为True,但代码只复制用户选择的第一个文件,而忽略任何其他文件。我错过了什么

With fDialog

      ' Allow user to make multiple selections in dialog box '
      .AllowMultiSelect = True

      ' Set the title of the dialog box. '
      .Title = "Please select a Video"

      ' Clear out the current filters, and add our own.'
      .Filters.Clear
      .Filters.Add "All Files", "*.*"

      ' Show the dialog box. If the .Show method returns True, the '
      ' user picked at least one file. If the .Show method returns '
      ' False, the user clicked Cancel. '

      If .Show = True Then

      ' This section takes the selected image and copy's it to the generated path'
      ' the string takes the file location, navigates to the image folder, uses the combo box selection to decide the file category, then uses the name from the filedialog to finish the path'

    FileCopy .SelectedItems(1), DLookup("Brand", "tmpDestFolders") & Dir(Trim(.SelectedItems.Item(1)))

     Else
      End If
    End With

循环浏览所有选定的项目

For i = 1 to .SelectedItems.Count
    FileCopy .SelectedItems(i), DLookup("Brand", "tmpDestFolders") & Dir(Trim(.SelectedItems(i)))
Next

循环浏览所有选定的项目

For i = 1 to .SelectedItems.Count
    FileCopy .SelectedItems(i), DLookup("Brand", "tmpDestFolders") & Dir(Trim(.SelectedItems(i)))
Next

您需要在
上循环。SelectedItems
集合,请参阅您需要在
上循环。SelectedItems
集合,请参阅