View Full Version : Open an explorer-window with the click on a button


fossy19
11-21-2010, 12:25 PM
I am modifying an Access 2010 database and I ran into a problem. VBA is probably the solution, but I am not familiar with it. Just scratching the surface I'm afraid...

I want to click a button in my customer-form, making Explorer.exe to open and show me the content of the customers folder on my server.

The database is basicly containing my customers name, contact data and sessionnumber.

I have tried this simple code:
Shell ("Explorer.exe /e,Link")

"Link" is the name of a calculated field in the main table connected to the form, and contains the correct path to the customers folder. I was hoping to make VBA read the "Link"-text in the table-field and open that folder for me, with just one click.

Can you please guide me to the solution?

Mr. B
11-22-2010, 04:30 AM
Here is a link that may help:
http://www.tek-tips.com/faqs.cfm?fid=6756

Here is another link:
http://vbadud.blogspot.com/2009/01/how-to-windows-explorer-using-vba.html

fossy19
11-22-2010, 12:23 PM
Thanks Mr.B, your reply pointed me in the right direction.

I did some more searching and found a code that solved my problem right away, this works for me!

Dim reVal
retVal = Shell("explorer.exe " & Me![Link], vbNormalFocus)


Here is a link to where I found it: (I was not allowed to post this with a link yet, so put in the missing "h" first)
ttp://bytes.com/topic/access/answers/584103-using-call-shell-open-specified-folder