Browse for File Question - File Name Combo Box

M

Michael Koenig

Greetings!

First, I would like to thank you all for providing this forum. You have
provided me with more assistance/guidance than you will ever know, and I
appreciate it greatly.

Using Ken Getz's Windows File Open/Save Dialog Box code
(http://www.mvps.org/access/api/api0001.htm), I have been able to restrict
my users to accessing only the files that I want by setting the Filename
combo box to a specific filename through VBA code. However, users being
users, they are quick to find and exploit any programming missteps that I
have made.

Recently, they have discovered that they can open the Filename combo box
drop down (identified as cmb13 in the MSDN Library) on the Open and Save As
Dialog Box, and can select any one of the previously accessed files that are
listed there. I've reseached the matter through MSDN, as well as here within
this forum, but I haven't been able to discover how to prevent them from
doing this.

My question is this:

Is there a way to change the Filename combo box to a text box?

OR

Is there a way to prevent the previously accessed files from appearing in
the drop-down? I've seen this in the standard Windows interface, when an
application is looking for a specific filename, so I know it can be done - I
just can't figure out how.

There is a snag to this scenario - I'm forced by corporate policy to use
Access 97 in developing databases, so my programming options are limited to
whatever Access 97, VBA 5 and DAO 3.51 will allow. Additionally, I am limited
in my programming experience, and this Browse For File code modification has
been my first foray into APIs. So please, be gentle.

I thank you for any and all help that you can give to me with regard to this
issue.

Respectfully,
 
M

Michael Koenig

Douglas,

Thank you! This worked wonderfully!

One question, though...

We're running Windows XP here in our office. In Ken Getz's example, the Open
File Dialog Box that is displayed is the standard Common Dialog Explorer -
type window. The example you recommended doesn't show the Places bar on the
left-hand side, which I assume is due to its being based upon a child
template (GWL_STYLE = (-16)). Any suggestions on how I might get the Places
bar to show in Dev Ashish's code?
--
Michael



Douglas J. Steele said:
You'd need to enable hooking, and use CDM_HIDECONTROL to hide cmb13.

Take a look at http://www.mvps.org/access/api/api0056.htm at "The Access
Web" (and make sure you get the AddrOf code, since you're using Access 97).

If you have problems figuring out how to use AddrOf, take a look at what
Stephen Lebans has at http://www.lebans.com/callbackbrowser.htm
 
D

Douglas J. Steele

Try adding the following 3 fields to the end of the declaration for
tagOPENFILENAME

pvReserved As Long
dwReserved As Long
FlagsEx As Long

(Ken's code was written a long time ago!)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Michael Koenig said:
Douglas,

Thank you! This worked wonderfully!

One question, though...

We're running Windows XP here in our office. In Ken Getz's example, the
Open
File Dialog Box that is displayed is the standard Common Dialog Explorer -
type window. The example you recommended doesn't show the Places bar on
the
left-hand side, which I assume is due to its being based upon a child
template (GWL_STYLE = (-16)). Any suggestions on how I might get the
Places
bar to show in Dev Ashish's code?
 

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

Top