File Browse code

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Is there code to implement a File|Browse and select fucntion on a form. I
want to set an external file reference for storing in the database for later
use and I'd like to use a Windows-like File|Browse rather than type it in
manually.

I have looked on various Access sites but can't find anything.

Help would be appreciated.
 
Hmm, Nick,

I think that it might be but there is so much code that I'm not sure what it
all does and how to use it.

Perhaps if I define the need a bit more clearly:
I have a database that accesses hundreds of images that are stored in
normal windows folders (i.e. not in an Access Database). The main folder
structure is always identical but, on different computers it might be
located in a different 'root' directory - e.g. in one an image might be in:
"C:\Pictures\Images\Image1.jpg" and on another it's in:
"F:\Material\Images\Image1.jpg". I have created a parameter that is used by
the database: - in example (1) it would be "C:\Pictures\" and in (2) it
would be "F:\Material\". Whenever the code needs to access an image, it
prefixes the 'standard' folder structure with the parameter value. It works
very well and makes the database easily portable between machines. At
present, when it is added to a new machine, I have to add this 'root' folder
location manually - on some it can be very long (especially when in
C:\Documents and settings\XXX\My Documents....etc.!) and easy to miss-type.
What I wanted to be able to do was to have a File|Browse function in the
form where the database field is displayed so that I can navigate to the
appropriate folder and sort-of <press enter> and it will populate the field
in the parameter table with the 'root' value.

Sorry it's been such a long description but hopefully it will be a pointer
that will help you to give me an idea of how I could use the proposed code.

Thanks for your quick reply!

Michael.
 
Michael,

The code from the link I posted will permit you to store a
path and filename into a field. With some modification it
would allow you to store a path and filename into seperate
fields.

If you want to store a path and folder (directory) name then
use the link Doug Steele has posted.

As to how to use the code contained in those examples, if
you don't have a glimmering of where to start then I suggest
you peruse the Access Developers Handbook (Getz, Litwin and
Gilbert) pub'd by Sybex appropriate for your version of
Access.

The reason I say that is because it's getting late and I
can't get my head round explaining where to start. Maybe
tomorrow......
 
This code worked great for me thank you for the hint. I have one question
though. What and where would i alter it so i canstart the folder search in a
folder other than the root directory? in other words when this function is
first invoked i want it to already be in a folder called "C:\FTP SERVER\SOL\".

thanks for your help.

jimmy davenport
 
Sorry, i am a little new to coding vba and vb. I see hear that you hear that
statement alot. Is there some instructions for using the modified code you
mentioned to me. I was able to use the code from the first time you helped me
but i am a little lost this time.

jimmydavenport
 
Actually, it's my fault this time. I misremembered what that example of
Stephen's did. It doesn't give you the Folder Browse capability that you
want.

What you want takes fairly advanced coding. Randy Birch has a sample at
http://vbnet.mvps.org/code/callback/browsecallback.htm Note that Randy's
site is aimed at VB programmers, not Access programmers, so sometimes his
examples don't port seamlessly into Access. However, I think this one
should, as long as you're using Access 2000 or newer.
 
I must be missing something in this thread Doug. Doesn't the OP simply
want to be able to specify a specific Folder for the Browse Folder
dialog to display? That's exactly what my example does.
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I may have downloaded the wrong example, but I thought yours was the File
Browse dialog, not the Folder Browse.

OTOH, that doesn't make sense, since the File Browse dialog has starting
folder built in.
 
Back
Top