select path open file

M

Marco

In a text field a have more than one path.
Can i select a path (with the mouse too) and open file with default windows
program?
ex
\myfoder\photo1.jpg \myfoder\photo2.mdi \myfoder\file1.gpx
i select with mouse \myfoder\file1.gpx and i desire open it

thanks
 
A

Allen Browne

That would be possible Marco. You will need to be familiar with VBA to
achieve it.

One way would be to select the file name, and then click a toolbar button to
open it. (You cannot use a command button on the form, because when you
click the button, you would lose the selection.)

This would involve creating a custom toolbar for the form, and using
SelStart and SelLength to read the information in the Text property of the
control. You can then use FollowHyperlink to open the file in whatever
program is the default for handling that file type.
 
M

Marco

Do you have a code sample?

Allen Browne said:
That would be possible Marco. You will need to be familiar with VBA to
achieve it.

One way would be to select the file name, and then click a toolbar button
to open it. (You cannot use a command button on the form, because when you
click the button, you would lose the selection.)

This would involve creating a custom toolbar for the form, and using
SelStart and SelLength to read the information in the Text property of the
control. You can then use FollowHyperlink to open the file in whatever
program is the default for handling that file type.
 
D

Douglas J. Steele

Why do you have more than one file path in a single field? Storing multiple
values in a single field is a violation of database normalization
principles. Store each path as a separate row in a second table (related to
the first table), and use a subform on your existing form.
 
M

Marco

Thanks for advice.
I have 1000 path in a field but only 10 with more than one and the aren't
the same 2,3 ect but some are 2 some are 5 some are 3 one 6, for me is
absurd add *10* field only for path.
 
D

Douglas J. Steele

I agree that it would be a mistake to have 10 fields for the path in your
existing table, but that's not what I suggested. I said to add a second
table, linked to the first table. You'd have one row in the second table for
each path, as opposed to the multiple paths occupying one (or more) fields
in a single row.

If the concept of database normalization is new to you, check some of the
resources Jeff Conrad has at
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101
 

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