Opening explorer and capturing file location into access form

phil-007

New Member
Joined
May 14, 2013
Messages
32
Hi All,

We have a DB that's used for logging work into our department, on the form thats used for logging a new job I want to put a field that you can store a file path from win explorer.

Is there a way to get use a command button to open explorer then once you've navigated to your file and selected it, it saves the path in the field?

P.S I only have limited Access/VBA skills so you may need to explain things slowly! :)

Thanks

Phil
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Upvote 0
This will open Windows Explorer from a command button
Code:
Private Sub Command35_Click()
Shell "explorer.exe /root,c:\aaa", vbNormalFocus
End Sub
 
Upvote 0
I have created an example that does exactly what you need:

Document Links 2
This is an update to the basic example of how to store the path to a file and also be able to view the file. You can browse using the standards windows common dialog to select the file. You can view the file using the application defined with the Windows File Associations. It uses the ShelExec API to open the file. It does not use the .Followhyperlink method.
This example is a continuous form that could easily be used as a sub form to attach multiple documents to a record.
***** Because it doesn't use the hyperlink data type, this new version stores the path in a way that allows the folder to be easily moved.
 
Upvote 0

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top