Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Browse for File Question - File Name Combo Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Koenig - 08 Nov 2006 16:11 GMT
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,
Signature

Michael

Douglas J. Steele - 08 Nov 2006 16:56 GMT
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

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Greetings!
>
[quoted text clipped - 45 lines]
>
> Respectfully,
Michael Koenig - 08 Nov 2006 22:19 GMT
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?
Signature

Michael

> You'd need to enable hooking, and use CDM_HIDECONTROL to hide cmb13.
>
[quoted text clipped - 53 lines]
> >
> > Respectfully,
Douglas J. Steele - 08 Nov 2006 22:38 GMT
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!)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Douglas,
>
[quoted text clipped - 84 lines]
>> >
>> > Respectfully,
Michael Koenig - 09 Nov 2006 14:39 GMT
Douglas,

Thank you - that seemed to do the trick!
Signature

Michael

> Try adding the following 3 fields to the end of the declaration for
> tagOPENFILENAME
[quoted text clipped - 93 lines]
> >> >
> >> > Respectfully,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.