Re: tool for finding paths to files

Tech-Archive recommends: Fix windows errors by optimizing your registry



Well, that's a rather tall order. One of the reasons I created the sample
databases is so you can pull them apart to see how they work. Nevertheless,
let me give you some background and then you can ask specific questions.

First, Import the module "modOpenSaveFile" into your application. Don't
make any changes to it.

Now, the way the thing works, is you call the "ahtCommonFileOpenSave"
function with the appropriate arguments and it returns a string that holds
the path and filename of the file you selected in the dialog box.

So in my PictureLoad sample, the call is behind the "Choose a Picture"
Button. The important part of the event procedure is this:

Dim strFilter As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "Picture Formats (*.jpg *.jpeg,
*.bmp, *.gif)", "*.jpg; *.jpeg; *.bmp; *.gif")
'MsgBox "You selected: " &
Filename = ahtCommonFileOpenSave(InitialDir:=pathname, _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Select Picture File")
'display picture
Me.txtStockGraph = Filename
Me.ImgStock.Picture = Filename

AS you can see, I'm calling the "ahtCommonFileOpenSave" function and
assigning the value to the variable "Filename". Then I assign the Filename
to a textbox on the form, which is how it gets entered into the table.
Exactly what YOU will do with Filename depends on your application.

You will also see that I assign a value to the variable strFilter. For the
PictureLoad sample, I only want to load picture formats. But you can change
this to include other file formats or ALL file formats. In the
"SetHyperlink" sample, I do this:

strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")

I hope this helps you get started.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L





"Ray Wallace" <raymondw@xxxxxx> wrote in message
news:e0ene7$obc$1@xxxxxxxxxxxxxxxxxxxx
Roger,
That looks exactly like what I am looking for. however, I am so new at
this
that I don't have know to implement it. Would you mind explaining.

I really appreciate you help. THANKS.
-Ray



"Roger Carlson" <NO-Roger.J.Carlson-SPAM@xxxxxxxxx> wrote in message
news:%23hZo6$zUGHA.4976@xxxxxxxxxxxxxxxxxxxxxxx
If you look here: http://www.mvps.org/access/api/api0001.htm, you'll
find
a
method of calling the Windows File Open/Save dialog box.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "PictureLoad.mdb" which uses this method to load the path
of
a
file into a field in a table. Another sample (SetHyperlink.mdb) uses
this
method to store the path to a file in a table as a hyperlink.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


"Ray Wallace" <raymondw@xxxxxx> wrote in message
news:e0e4o2$k5h$1@xxxxxxxxxxxxxxxxxxxx
The users of my form need to define the location of a file they were
working
on. Instead of typing or pasting the path and filename into a text
control.
I want them to have the choice of clicking a browse button to define
that
path. Is there some sort of control out there that can do this

Ray








.


Quantcast