tags:

views:

32

answers:

2

Hi

Ive just inherited an MS Access 2003 system and need a bit of VBA to put behind a command button to open MyComputer at a specific folder to view the files there. The folder name will come from a field on a form. I did have

Application.FollowHyperLink "C:\" & Me![ref] (ref is in the format abcd-1234)

when its hard-coded it works fine, but i cant seem to get it to open when picking the foldername up from the form.

any hints? (other than binning access!) thanks

+1  A: 

got it using the Shell command instead

thanks

DarkWinter
+1  A: 

See what the text looks like as you're submitting it to FollowHyperlink. You can insert a line like this in your code:

MsgBox "C:\" & Me![ref]

Perhaps it's not what you expect. It's always good to check.

What happens when it doesn't work. Do you see any error messages or any other symptoms which could help us nail this down?

My first thought was spaces in a folder name might create problems. But I don't think that's the answer because FollowHyperlink works fine for me in this example:

Application.FollowHyperlink "C:\Access\spaces in name\"

So the best I can offer is to see what you're asking FollowHyperlink to use. If that effort doesn't lead you to the answer, add a specific example which fails to your question.

HansUp
David-W-Fenton