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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog Control

Status
Not open for further replies.

nvwildfire

Technical User
Aug 15, 2002
43
US
Hi list, hopefully this will be easy. I am trying to add a common dialog control to an access 2002 form, but I keep getting an error that says "The OLE server isn't registered. To register the OLE server, reinstall it.". What does this mean? If I try to add the common dialog control after the first error I get a second message that says "You don't have the license to use this ActiveX control ...." I am assuming I get this because the OLE server isn't registered?

All I am trying to do is get some user input on where a file is. I want the user to be able to browes to the file so that I can get the file location and put it in a text field in my database. Is there another way to do this instead of using the common dialog control? This is the only way I know how to allow useres the ability to browes to a file.

Note that I am using access 2002 sp2 and microsoft common dialog control v.6. And if it matters I have ADO 2.5 referenced on the VBA side.

Any help would be greatly appreciated.

thanks,

kgk

krauter@unr.edu
 
There are several FAQs on this subject in various Access forums. Click the Keyword Search tab above your post and search the full text of the FAQs on the words "common dialog". Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
In order to use the common dialog, you have to insure that the component for microsoft common dialog has been selected as listed in the instructions below...

Microsoft Visual Basic Module, Select Tools, then select "Microsoft Common Dialog Control 6.0 (SP3)".

[Do not try to add the activex control to the form!]

Once that is done, try this code...

Dim comDialog As Object
Set comDialog = CreateObject("MSComDlg.CommonDialog")

comDialog.DialogTitle = "Select File"
comDialog.Filter = "Microsoft Excel (*.xls)|*.xls|Standard XML 4.0 (*.XML)|*.XML"
comDialog.ShowOpen

'Retrieve File name...
Me.lblFile.Caption = comDialog.FileName



God Speed with your code my friend...
 
Thanks dsmall6141!

I will have to try that. I did read something that you have to have msVB6 running on your computer to use some activeX controls. Hopefully this works. I've got VS6.0 on my home computer but not at work, so hopefully this works so I don't have to work at home.

kgk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top