Common Dialog Problem

Nero

Shop smart, shop S-Mart
Local time
Today, 13:09
Joined
Jan 8, 2002
Messages
217
Hi all,
I developed a database which stores the path to an image in a table. I use the common dialog box to allow the user to select an image from a network drive which then inserts the file name into the table. On my pc this works fine and on about 50% of the users pc' it works fine but the other 50% I have problems with.
If I go into edit view on my pc I can pick up the common dialog from the toolbox no problem. On some of the user's pc's this cannot be done.When you scroll through the 'more tools' it just is not there.
Is there something simple I am missing here??


Thanks.
 
The common dialog box is not automatically registered. It depends on the Office installation options and on other programs that might also use it - because some programs use the .OCX that Access normally uses, but Pat Hartman has shown another way to do that with the COMDLG32.DLL file that is ALSO on some Windows systems. So whether the .OCX or the .DLL is active on your systems depends on lots of complex ifs, ands, and buts. So let's just assume that the common dialog file is present but not properly referenced by Access on the machines that have trouble.

COMDLG32.OCX (the Active/X version) has to be made available as a reference AND has to be registered as a second step. The same is true for COMCTL32.OCX vs. the .DLL version. (That's the Common Controls file. They usually go together.)

Anyway, get to one of the PCs that has the problem. Open up any code window - class module or general module, makes no difference. You will see the Menu bar change (AC97) or will get a new menu bar on the code window (AC2K).

OK, on the code window menu bar, follow

Tools>>References.

That will bring up a complex dialog box. If you select one of the lines in the box, the name and path of the file that embodies that reference will be displayed at the bottom of the box. That might help you by showing you what file Access is seeking.

Check for the "Common Dialog" module. Several possibilities exist here.

1. If it exists but isn't checked, check it.
2. It isn't in the list at all.
3. It is in the list and is checked, but the word MISSING (yes, in all caps) precedes the module name.
4. It exists, is checked, and isn't missing.

In cases 2 & 3, use the browse button of the dialog box to find the required file in your Windows directory, probably in the SYSTEM32 folder, with a name like COMDLG32.OCX. Select that file via double-click. Make sure it is checked in the References dialog box. Then close that box and try again.

In cases 1 & 4, or if the reference activation didn't help, the next step is to follow menu bar option

Tools>>Active X...

to a dialog box that will allow you to REGISTER your Active-X controls. Try to find the COMDLG32.OCX file through that box. Try to register the OCX file.

NOTE: There can be one more speed bump in the way. If you cannot register the file, search this forum for the topic "Register Active X" or "Register Common Dialog" - at least a couple of articles have links to MS Knowledge Base articles that address that problem. I don't have the reference at hand so can't repeat it to you. But that should get things going for you.
 
Last edited:
Doc_Man.
Thanks very much for your quick reply.
I had checked the references and they showed up as MISSING.
I copied the .dll /.ocx files onto the pc.
They now show that they are not missing but still no common dialog control.
It must be the registering part that I need to do.
I will have a go at this now.

Thanks again.
 
RESOLVED

If anyone else has this problem the answer is to use the 'Regsv32.exe' from the Microsoft download centre.
Drag and drop the controls onto the file and it will register them for you.
It works with both full Access and Runtime Access.
 
Rather than deal with this issue which becomes even more of a problem if the app is a consumer item so that you have no access to or control over their environments, I have switched to using the CommonDialog via the API. It is a little more complicated because of the amount of code but you shouldn't have to change any of it. Just copy it into a standard code module.

ACC97 How to Use the Common Dialog API in an Access Database (Q303066)
 
Thanks Pat
I see your point. Luckily I can access everyones pc to register the controls.
I will bear your suggestion in mind for any external work that I do.

Thanks again.
 
Nero,

For the same reason underlined by Pat I've also definetly switched to APIs for that purpose.
However, I did run into problems while using the regsv32.exe in another context (writing code to autmatically detect and repair broken references on startup).
The point is that I cannot find a mean to close the regsv app. It stays active in the background (see the taskbar manager), consuming machine resources and eventually generating pb if called various times in a same windows session (accumulated opened sessions of regsv...).

Would you by chance have found a way to avoid this pb?
 
Last edited:
Alex,
I think I will take yours and Pat's advice and switch to API's.
I have only just become aware of the registering problems (probably more luck than judgment).
I havn't come across the pb problem yet but if I do and find some sort of solution I will be sure to let you know.

Kev.
 

Users who are viewing this thread

Back
Top Bottom