I am trying to create a file dialog with Microsoft Access 16.0 Object Library checked. However, the Compile Error: User-defined type not define still exists. Please help.
My code below if it helps:
My code below if it helps:
VBA Code:
Public Function DirPicker(Optional ByVal strWindowTitle As String = "Select Location to Save") As String
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
fd.Title = strWindowTitle
If fd.Show = -1 Then
DirPicker = fd.SelectedItems(1)
Else
DirPicker = vbNullString
End If
Set fd = Nothing
End Function