Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

double click path to open the file

Status
Not open for further replies.

miketamp

Technical User
Jan 28, 2005
20
GR
Hi i have a listbox "mylistbox"which takes file names as values.i want when i double click on the listbox, to open the file.As i read in the thread702-336241 i had to make a label called "myhyperlink "and at the double click event of the "mylistbox" i had to enter this code:

Private Sub MyListBox_DblClick(Cancel As Integer)
MyHyperlink.HyperlinkAddress = "C:\Program Files\diet\diets\express" & MyListBox
MyHyperlink.Hyperlink.Follow
End Sub

because the files i'm trying to open are in that path.
Now when im trying to run that i have runtime error '2455' and i have a yellow mark at the line MyHyperlink.HyperlinkAddress
why is that?what is wrong.I use access xp.at the thread702-336241 sais that it works fine.why not here?
please help me
 
If express is a folder you probably need a \ after it (depends on what the entries in your listbox begin with)
 
i tried with \ too but nothing happened.
Can you please help me?
 
I suggest you put a msgbox into the code to see what is going on:

Private Sub MyListBox_DblClick(Cancel As Integer)
MyHyperlink.HyperlinkAddress = "C:\Program Files\diet\diets\express" & MyListBox

msgbox "C:\Program Files\diet\diets\express" & MyListBox

MyHyperlink.Hyperlink.Follow
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top