파일 대화 상자를 여는 버튼을 만들려고합니다. 그런 다음 데이터베이스가있는 폴더로 복사 할 이미지를 선택할 수 있습니다. 나는이 코드로 작업 해왔다.하지만 나는 filecopy 명령에 갇혀있다. 제대로 포맷 할 수 없다. 나는 경로를 만드는 특정 폴더를 선택하기 위해 데이터베이스의 경로와 몇 개의 폴더를 사용한 후 마지막으로 콤보 상자를 사용합니다 (데이터베이스가 이동되고 콤보 상자가 범주를 기반으로 이미지를 정렬하면 끊어지지 않도록) . 여기에 제가 사용 해본 코드가 있습니다. 고마워.MS-ACCESS "파일 대화 상자에서 vba를 통해 파일 복사 중
Private Sub Command156_Click()
Dim fDialog As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
' Set up the File Dialog. '
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
fd.InitialFileName = [Application].[CurrentProject].[Path]
With fDialog
' Allow user to make multiple selections in dialog box '
.AllowMultiSelect = False
' Set the title of the dialog box. '
.Title = "Please select a Image"
' 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
filecopy([.SelectedItems],[GetDBPath] & "\Images\Equipment\" & Combo153)
Else
End If
End With
End Sub
그래서 문제/귀하의 질문은 무엇입니까? – JohnFx
괄호'(','['및']')를 제거합니다. 구문은'FileCopy SourceFile, DestinationFile'입니다. –