473,503 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FindDialog reference is missing

6 New Member
I would like to display a file dialog using vba, so that the user can select a file and path. I copied and pasted the MS example to test, but can't get past the declaration; I get an error saying "Compile error: User defined type not defined" and the text "fd as FileDialog" in my declaration is highlighted. This says to me that I'm missing a reference - but which one??
Sep 24 '07 #1
8 3224
cyberdwarf
218 Recognized Expert New Member
You will need to make an additional reference to the Microsoft Office 10 (or 11, etc) Object Library.

HTH

Steve
Sep 24 '07 #2
Jim Doherty
897 Recognized Expert Contributor
I would like to display a file dialog using vba, so that the user can select a file and path. I copied and pasted the MS example to test, but can't get past the declaration; I get an error saying "Compile error: User defined type not defined" and the text "fd as FileDialog" in my declaration is highlighted. This says to me that I'm missing a reference - but which one??
Which version of Access are you using please? for instance if it is ACC 2002 then Microsoft Office 10.0 Object Library If it is ACC 2003 then Microsoft Office 11.0 Object Library.

Please note various functionality is always going to be version dependant. For instance if you were using Access version 1 or 2 then this functionality would not be available and you would be calling on the windows application programming interface (API) to achieve the same thing. It is only with progressive development and later versions that hitherto complex modules are reduced to single commands like..............FileDialog

So as mentioned in para 1 if you are using ACC 2003 then go into the VBA module TOOLS...REFERENCES ensure that the library is selected and ticked in the list.


Regards

Jim :)
Sep 24 '07 #3
lynnchester
6 New Member
Thanks for the help - it seemed to work, but then I updated my database to 2003 (I've been using Access 2003 but the database itself was in 2000 format) and now it's no longer working - I'm getting the original problem again.
I'm not 100% sure the upgrade is what caused it, as I haven't tested the FileDialog function for some time - just started working on it again today after a few weeks. MS Access 11.0 Object Library is definitely selected in References...
Nov 7 '07 #4
Jim Doherty
897 Recognized Expert Contributor
Thanks for the help - it seemed to work, but then I updated my database to 2003 (I've been using Access 2003 but the database itself was in 2000 format) and now it's no longer working - I'm getting the original problem again.
I'm not 100% sure the upgrade is what caused it, as I haven't tested the FileDialog function for some time - just started working on it again today after a few weeks. MS Access 11.0 Object Library is definitely selected in References...
Post the offending module code (please remember to use code tags) so that contributors can see what code you originally pasted into your database and also list the references (in the order that you have them in the list)

Regards

Jim :)
Nov 7 '07 #5
lynnchester
6 New Member
I've tested the code just with the one line in it and it still errors:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdImportJobs_Click()
  2.  
  3.     '---------------------------------------------------------
  4.     'Declare a variable as a FileDialog object.
  5.     '---------------------------------------------------------
  6.     Dim fd As FileDialog
  7.  
  8.     '---------------------------------------------------------
  9.     ' Create a FileDialog object as a File Picker dialog box.
  10.     '---------------------------------------------------------
  11.     Set fd = Application.FileDialog(msoFileDialogFilePicker)
  12.  
  13. End Sub
I have the following references:
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library
Nov 7 '07 #6
Jim Doherty
897 Recognized Expert Contributor
I've tested the code just with the one line in it and it still errors:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdImportJobs_Click()
  2.  
  3. '---------------------------------------------------------
  4. 'Declare a variable as a FileDialog object.
  5. '---------------------------------------------------------
  6. Dim fd As FileDialog
  7.  
  8. '---------------------------------------------------------
  9. ' Create a FileDialog object as a File Picker dialog box.
  10. '---------------------------------------------------------
  11. Set fd = Application.FileDialog(msoFileDialogFilePicker)
  12.  
  13. End Sub
I have the following references:
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library

Check that you not only have the MS Access 11.0 object library but you also have the MS Office 11.0 object library.

Jim
Nov 7 '07 #7
lynnchester
6 New Member
You darling! Thanks Jim.
Nov 8 '07 #8
Jim Doherty
897 Recognized Expert Contributor
You darling! Thanks Jim.
hahah long time since I was called that on any forum ...glad it worked out for you :))

Jim :)
Nov 8 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

14
1902
by: Arik Funke | last post by:
Hi together, following code does compile fine on MS VC but not on gcc. What am I doing wrong? Is there a universal coding standard? Cheers, Arik --- class abc {
1
5734
by: S. van Beek | last post by:
Dear reader, I can "able" and "unable" (disable) reference libraries in the reference form of VBA with Tools/References.. But is there code available in VBA to disable a missing...
3
7333
by: selen | last post by:
Hello I add Microsoft Word 10.0 Object Library from reference com. and I am writing my code to create an instance of a Word application.My code is Word.ApplicationClass oWordApp = new...
5
8900
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
2
2564
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
6
1470
by: Just Me | last post by:
My Task List contains the following: At least one reference is missing the 'Name' attribute. Any suggestion on how toe find which project is missing it? Solution contains 25 projects. ...
12
4727
by: lesperancer | last post by:
I've got two MDBs, that due to size, security, etc, need to be kept separate quotation configurator (there will be more of these in the future) so within quotation.mdb, I linked all the...
5
1963
by: Gustaf | last post by:
Here's what happens: I got a Web Service installed locally on my IIS. Then I got a client project, which will call this service. But when I add the Web Reference to the Web Service, and look at the...
2
24991
by: m.a | last post by:
Hello, I have the following code which is an entity for a table in my database. but I am getting several errors such as: The type or namespace name 'ColumnAttribute' could not be found (are...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.