listbox to open files

T

Todd

I have a sub table called subLinks. This is a referential table that stores
a list of related files to a person's record in tblMaster. The link is
stored in a field called fldLink. This field has data like...
t:\docs\Plan 106.doc

I have a listbox that shows all links related to each person's record. They
are matched up by field LinkID. I want to be able to double click on each
item listed on the listbox to open the document. Is this possible? I
thought I could do it using the Shell("path") code, but I'm having problems
with it.

First question... is this possible?
Second question... what code do I use to open the correct file from listbox?

Sorry, I'm terrible with recordsets! Thanks in advance!!!
 
J

John Nurick

Hi Todd,

It's usually simpler to do this with a subform in continuous view,
containing a single textbox bound to fldLink. Format the subform to look
like a listbox if you want. (Among other things, AllowAdditions,
AllowDeletions, AllowEdits should all be False, and the textbox should
be locked.)

In the textbox's DoubleClick event procedure, just put something like

Application.FollowHyperlink Me.ActiveControl.Value
 
T

Todd

Thanks for the advice!


John Nurick said:
Hi Todd,

It's usually simpler to do this with a subform in continuous view,
containing a single textbox bound to fldLink. Format the subform to look
like a listbox if you want. (Among other things, AllowAdditions,
AllowDeletions, AllowEdits should all be False, and the textbox should
be locked.)

In the textbox's DoubleClick event procedure, just put something like

Application.FollowHyperlink Me.ActiveControl.Value
 

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