Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

filedialog compile err..using lib 11..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nycdon - 31 Mar 2005 12:09 GMT
i'm still getting compile error on dim stmt below, even after setting
reference to MS Lib 11..any ideas? (access 2003)

Dim dlgOpen As FileDialog
 
  Set dlgOpen = Application.FileDialog( _
    FileDialogType:=msoFileDialogOpen)
 
   With dlgOpen
    .AllowMultiSelect = True
    .Show
   End With
Terry - 31 Mar 2005 14:53 GMT
Go with Douglas' solution. I have had the API version running nicely for a
fair while. Recently I thought the FileDialog would be a neater solution as
it also included a folder browse - it was a nice solution BUT, the problem
with references was an utter pain. I have returned to the API call. If you
have Access Developer solutions for both the FileDialog and the Folder Browse
are in the Code Librarian or use Douglas' hLink
Terry

> i'm still getting compile error on dim stmt below, even after setting
> reference to MS Lib 11..any ideas? (access 2003)
[quoted text clipped - 8 lines]
>      .Show
>     End With
Dirk Goldgar - 31 Mar 2005 21:55 GMT
> i'm still getting compile error on dim stmt below, even after setting
> reference to MS Lib 11..any ideas? (access 2003)
>
> Dim dlgOpen As FileDialog

*Which* "MS Lib 11"?  "Microsoft Office 11.0 Object Library" would be
what you need;  a reference to "Microsoft *Access* 11.0 Object Library"
(emphasis mine) isn't enough.  But I agree with Doug Steele and
others -- calling the API directly is really the way to go.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Dirk Goldgar - 31 Mar 2005 22:06 GMT
>> i'm still getting compile error on dim stmt below, even after setting
>> reference to MS Lib 11..any ideas? (access 2003)
[quoted text clipped - 6 lines]
> and
> others -- calling the API directly is really the way to go.

I just saw from a separate message of yours that you *are* referencing
the Office library.  So I don't know why you would be getting an error
on the Dim statement.  When I test this in Access 2002, though, I get an
error on the line

>   Set dlgOpen = Application.FileDialog( _
>     FileDialogType:=msoFileDialogOpen)

because the example in the help file is just plain wrong, and the
argument should be specified as:

  Set dlgOpen = Application.FileDialog( _
    DialogType:=msoFileDialogOpen)

or even just

  Set dlgOpen = Application.FileDialog(msoFileDialogOpen)

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.