Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msoFileDialogFilePicker not found

Status
Not open for further replies.

lcky

Programmer
Sep 29, 2005
30
0
0
GB
Hi
I am using Microsoft Access 2003.
I have a test form with a listBox field and a button.
On Button cmdFileDialog_Click(); I have following code.

Private Sub cmdFileDialog_Click()
Dim fDialog As FileDialog
Dim varFile As Variant

' Clear the list box contents.
Me.FileList.RowSource = ""

' Set up the File dialog box.
'Set fDialog = Application.FileDialog(FileDialogType:=msoFileDialogOpen)
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
....
....
End Sub

I have also added "Microsoft Office 11.0 Object Library " in References code database window.

When I click on button, i am getting error saying "User-defined type not defined" with hightlighted "msoFileDialogFilePicker".

I am lost here again.

Please you suggest any idea.

Many thank
 
lcky,

I am not using the 2003 version, so it's hard to test why this is not working. The code below will make the values available. Paste them into the form using the dialog code, or prefix them with Global and paste them in a module.

const msoFileDialogOpen = 1
const msoFileDialogSaveAs = 2
const msoFileDialogFilePicker = 3
const msoFileDialogFolderPicker = 4

If you know what the object browser is, you could try finding the values in the office library.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top