Path = "Z:\Ebay\Suppliers Inventory\" & Fnumber & "\" & Fname & "\"
直到最后一个(&“\”),然后路径将失败。我的SKU是(XXX-000001)不确定短跑是否是问题,并且在这个较晚的日期会很难解决。
Dim objFSO As Object
Dim objFile As Object
Dim openDialog As FileDialog
Dim Path As String
Dim GetPath As String
Dim Filename As String
Dim GetFileName As String
Dim Fname As String
Dim Fnumber As String
Fnumber = Me.FolderNumber
Fname = [SKU]
Path = "Z:\Ebay\Suppliers Inventory\" & Fnumber & "\" & Fname & "\"
Set openDialog = Application.FileDialog(msoFileDialogFilePicker)
openDialog.InitialFileName = Path
openDialog.AllowMultiSelect = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set openDialog = Application.FileDialog(msoFileDialogFilePicker)
openDialog.AllowMultiSelect = False
If openDialog.Show Then
GetFileName = openDialog.SelectedItems(1)
Else
GetFileName = ""
End If
Forms![Items to List].ImageGroup.Form.PicText = GetFileName
Me.Image2 = GetFileName