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

? Common File Dialog in Access ? 1

Status
Not open for further replies.

raddster

Programmer
Apr 5, 2001
15
US
I have an access application where I'd like to present the user with a common file dialog box, similar to that in Visual Basic 6. Where they can select a txt file or group of txt files to be parsed into a table.

How do I duplicate the file dialog box? It is so easy in visual basic but I can't find how to do this in access.

Any help will be greatly appreciated.

Thanks,
Steve
 
Hi raddster,
If you have access to the Common Dialog Control in Access. In Form design view, select Insert | ActiveX Control. Locate "Microsoft Common Dialog Control" - you probably want the most recent version. Add it to your form, and reference it in code by its name.

If, on the other hand, you work for some company that purposely denies you access to the common dialog control (you'll be able to tell when you're unable to add the control to the form because it says it's unregistered), see for the solution. :)
 
Katerine,

Thank you for your reply. I was able to add the common dialog control on my machine since I have VB6 installed. However, it won't work on any other machine that doesn't have VB6 installed on it, which is the case for most of the users. I was hoping that there was a work around using Access 2000 commands to emulate the common dialog control. It's a shame that Microsoft didnt' think anyone would need this functionality (geesh).

I found that if I purchase the "Developers" version of MS Office the dialog is included and the ability to distribute apps as well. I was hoping to be able to accomplish this without having the added expense.

Again, Thanks for your reply.

Steve
 
Hi raddster,
The additional expense shouldn't be necessary. Check out the link I posted above.. that solution will work in Access 2000 without having to purchase anything beyond the professional edition.
 
As I pound my head against the desk, for not reading ALL your first reply... X-)

Thank you so very much for having the patience to have me re-read your reply and look at the link. The solution works flawlessly. I'm grateful to you and to RickSpr for his earlier post to your question.

Dang, it's Great having a network of friendly folks willing to share their skills.

Your friend,
Steve :-V
 
Katerine,

One more question, if I may. How do I set the AllowMultiselect flag in this class? It's defined as cdlOFNAllowMultiselect = &H200 but won't let me select mutiple files.

Thanks again,
Steve (-:
 
Hi raddster,
I found this at
'default open flags and multiselect
.flags = OFS_FILE_OPEN_FLAGS Or _
OFN_ALLOWMULTISELECT


He uses slightly different constant names, but they should be fairly easy to replace with your constants. "OFN_ALLOWMULTISELECT" corresponds to "cdlOFNAllowMultiselect."

This code is located within a With loop (in the form code, not in the class module), which references the common dialog object. Call it before you call ShowOpen.

The "flags" property is a var of type Long. Not entirely sure how that logic works, I just copied it as it was.

HTH (I really have no idea if it will or not) :) Katie
Hi! I'm currently studying the COM+ programming model. Hopefully YOU'RE having fun, which would make one of us..
 
Katie,

Thanks again.

I replaced the constants and it worked like a charm.

Good luck with COM+ object model. I hear it can be a real pain, but the knowledge will be invaluable to you.

Steve :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top