listbox to open files

  • Thread starter Thread starter Todd
  • Start date Start date
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!!!
 
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
 
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
 
Back
Top