Windows explorer in a form to select a folder/path

A

Amit

Windows XP, MS Access 2K
========================
Hi,

I have a form that has a textbox control to input the path
of a folder on the shared drive
(eg. "h:\shared\general\whatever\folder\"). Is there a way
to achieve the same thing by bringing up the windows
explorer and selecting the desired folder/path instead of
typing it? Will I have to change the control to Hyperlink
instead of text?

Thanks for any pointers.

-Amit
 
A

Amit

-----Original Message-----
The code in this link will allow you to browse for a folder:
http://www.mvps.org/access/api/api0002.htm

--

Hi Allen,

Thanks a bunch! That worked fine. But, I seem to have
another porblem. I changed the fieldtype to Hyperlink, and
it seems to work sometimes, and at other times, it
doesn't. That is, when I place the mouse over the control,
the cursor changes to the "hand", similar to the cursor
for clickable links on a webpage, but when I click on it,
it doesn't always open the Windows Explorer. The path-name
is valid and correct.

I have no procedure in the "On Click" event. I do have
code in the "On Double Click" event, but it executes only
if the field value is null, or empty string.

Any ideas as to what's wrong here, and how to correct it?

Thanks!

-Amit
 
A

Allen Browne

Hi Amit

If you change the field to a hyperlink, you need to format the resultant
string as a hyperlink. For example, if the user browsed to:
C:\MyPath\
you would need to create the hyperlink
C:\MyPath\#C:\MyPath\#

If that is new and you need an explanation, see:
Introduction to Hyperlink fields
at:
http://members.iinet.net.au/~allenbrowne/casu-09.html

Clicking on a hyperlink that is a folder should fire the Windows Explorer.

You also do have the choice to store the path in a Text type field. That
might be the better choice if you are wanting to combine the path with a
file name stored in another field, so you do not have to parse the path from
the hyperlink with HyperlinkPart().
 

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