我对VB完全不熟悉,请原谅我的经验不足。我在Access中有一个表单,其中有一个名为" Command17"的按钮。当用户点击按钮时,我需要它来要求用户输入目录。这是一个由其他人启动的项目,我在VB窗口中看到的是:
有人可以帮忙吗?
答案 0 :(得分:0)
您需要使用应用程序的目录文件对话框对象并返回路径字符串:
Dim intResult As Integer
Dim strPath As String
intResult = Application.FileDialog(msoFileDialogFolderPicker).Show '<-- show the folder picker
If intResult <> 0 Then '<-- if the user didn't cancel
MsgBox Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1), vbInformation, "Selected Folder" '<--here the selected folder's path that you can use for your scopes
End If