K
keith
Hello,
I am using a form command button to open a file dialog so the user can
select a file. From the VBA Access help, I obtained the following code and
pasted it into the Command2 control code as shown below. Unfortunately, it
does not work.
The error received is ….
“User-defined type not definedâ€
I tried adding references to Visual Basic for Applications, but the problem
continues.
What is needed to make this code work?
The code example from the VBA help is shown below.
Thank you
keith
Private Sub Command2_Click()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True ‘ need to change this to false to select
only one?
.Show
End With
End Sub
I am using a form command button to open a file dialog so the user can
select a file. From the VBA Access help, I obtained the following code and
pasted it into the Command2 control code as shown below. Unfortunately, it
does not work.
The error received is ….
“User-defined type not definedâ€
I tried adding references to Visual Basic for Applications, but the problem
continues.
What is needed to make this code work?
The code example from the VBA help is shown below.
Thank you
keith
Private Sub Command2_Click()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True ‘ need to change this to false to select
only one?
.Show
End With
End Sub