Image Path

  • Thread starter Thread starter grep
  • Start date Start date
G

grep

I'd like to allow users to specify the path they're going to use for
their graphic images. I don't want to store them in the database itself,
so I need a path for them. I'd like the users to be able to use an
Explorer-type browse function to select their destination directory. How
can that be done?

TIA,

grep
 
I'd like to allow users to specify the path they're going to use for
their graphic images. I don't want to store them in the database itself,
so I need a path for them. I'd like the users to be able to use an
Explorer-type browse function to select their destination directory. How
can that be done?

Try this API code...

http://www.mvps.org/access/api/api0001.htm

- Jim
 
I'm trying, but it's a bit complicated... I'll have to play with it some
more. A more straightforward approach would be very much appreciated.
 
I'm trying, but it's a bit complicated...
I'll have to play with it some more. A
more straightforward approach would
be very much appreciated.

Alas, the referenced

is about as simple as it can be made. It even includes example code on how
to use it. If you'll start with that sample code, and modify it for your
environment, it should not seem all that complex. Stick with it and I
suspect it will "come clear" before long.

Frankly, it is much simpler than using an ActiveX control and having to
distribute it with your database. Many, including me, think it simpler than
using the three separate builtin controls that were provided in classic VB.

Larry Linson
Microsoft Access MVP
 
grep said:
I'm trying, but it's a bit complicated... I'll have to play with it
some more. A more straightforward approach would be very much
appreciated.

Use Application.FileDialog of the Microsoft Office Object Library (you need
a reference). Here is a sample code:

Dim fd As FileDialog
Set fd = FileDialog(msoFileDialogFilePicker)
fd.AllowMultiSelect = False
fd.Filters.Clear
fd.Filters.Add "Images", "*.gif; *.jpg; *.jpeg; *.png"
If (fd.Show) Then
MsgBox fd.SelectedItems(1)
End If

HTH,
Boris
 
Thanks, Boris, I'd tried something similar. The problem with it is that
what I'm actually looking to do is select the Folder, not the file. I
found that even using msoFileDialogFolderPicker somehow doesn't actually
let you select a folder, per se. There seems to be no way to make a
folder the ultimate target.

I'm getting the impression that Larry and Jim are right. It just seems
to be a whole lotta work for a relatively simple thing. I pine for the
days when one could just say, "Type in the path for the files" and
actually expect that users would know what that was. <sigh>

Ah well...

grep
 
grep said:
Thanks, Boris, I'd tried something similar. The problem with it is
that what I'm actually looking to do is select the Folder, not the
file. I found that even using msoFileDialogFolderPicker somehow
doesn't actually let you select a folder, per se. There seems to be
no way to make a folder the ultimate target.

This way you should get the path of the selected folder:

Dim fd As FileDialog
Set fd = FileDialog(msoFileDialogFolderPicker)
If fd.Show Then
MsgBox fd.SelectedItems(1)
End If

Boris
 
Back
Top