FileDialog object breaks program flow.

  • Thread starter OfficeDev18 via AccessMonster.com
  • Start date
O

OfficeDev18 via AccessMonster.com

Hello,

I have the following Dim statement in a module:

Dim fd As FileDialog

I have the library Microsoft Access10 Object Library referenced. However, my
program breaks on the Dim, with the error message "User type not defined."
It's been working 'til now. What's wrong?

I'm using A2003.

Thanks for the help,

Sam
 
O

OfficeDev18 via AccessMonster.com

I found the answer. When I opened the Object Browser, typed in "FileDialog",
and got the response (Access, Application, FileDialog), I clicked on the
active link "FileDialog" at the bottom of the page. I got an error message
saying "Cannot jump to FileDialog because it is in library Office which is
not currently referenced." Taking the hint, I added MS Office10 Object
Library to my references, and voile, everything works.

Interesting, but wierd.

Sam
 
A

Allen Browne

Sam, if you are using Access 2003, it is not a good idea to use the Office
10 library. Use the Office 11 library if you must.

As you are discovering, FileDialog can break your application, and has
problems between versions. It does not work in the runtime version of
Access, and it does not work at all for Save As (even through it appears to
offer that option.

You would be much better off to dump FileDialog, and instead use the API
code from this link:
http://www.mvps.org/access/api/api0001.htm
It avoids all those problems.
 
O

OfficeDev18 via AccessMonster.com

Hi, Allen,

Oops, you caught me at my lie (red face). I'm using A2002, not 2003. Ergo,
Office10 is the only option.

Thanks for setting me straight.

Sam

ps I'm only using FileDialog for the FilePicker option.

Allen said:
Sam, if you are using Access 2003, it is not a good idea to use the Office
10 library. Use the Office 11 library if you must.

As you are discovering, FileDialog can break your application, and has
problems between versions. It does not work in the runtime version of
Access, and it does not work at all for Save As (even through it appears to
offer that option.

You would be much better off to dump FileDialog, and instead use the API
code from this link:
http://www.mvps.org/access/api/api0001.htm
It avoids all those problems.
I found the answer. When I opened the Object Browser, typed in
"FileDialog",
[quoted text clipped - 24 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

fileDialog 2
a compile error 6
Error in FileDialog 2
mso.dll for filedialog 2
FileDialog Widget 2
how to retrieve the file extension 4
Access 2000 - FIle Open Dialogue 4
FileDialog 2

Top