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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Links in field on form to files on hardrive

Status
Not open for further replies.

SimonCleaver1

IS-IT--Management
Aug 21, 2003
2
ES
Hi
Is it possible to have a field (text, memo or other) on a form whereby I can put shortcuts to files in a directory that are associated with each record.
I have a database of clients - I write individual letters and photofiles to these client and would like to be able to list on each clients record what I have sent to them. It would also be nice to be able to click on the link or shortcut and the corresponding file is opened for viewing.
Is this possible? Thanks very much for any help or advice given.
 
This sounds like a case for SHELL. Look it up in Help and if you cannot find post back here.

rollie@bwsys.net
 
Thanks Rollie,
I have looked up Shell in VBA help - but I was hoping for an easier way to maybe cut and paste or drag filename into the field and then be able to click on it to open the document. All the files are stored in a folder and I use the client ID number as the first part of the filename.
Any thoughts we be greatly appreciated.
Simon
 
Simon,

Put the URL's in a text field in a table and send that info to SHELL

Rollie E
 
There is another possibility.

Create a new table and call it something like documents. Then create 3 fields in the table: AutoNumber, ClientKey and Documents.

AutoNumber = AutoNumber
ClientKey = Related key in Client table
Documents = A field with a Data Type of OLE Object

Once the table is built and open if you right click in the Documents field it will give you the choice of applications to create a document in or attach a selected file.

Hope this helps!
 
Thanks for the advice - I tried the new table method but received an error message saying there was a problem with the OLE Server or ActiveX control and I should restart it outside of my database and the re-open the database.
Does anyone have any ideas what may have caused this - I have search the MS Knowledge base but cant seem to get anywhere.
Thanks
 
Hi, I got this from someone last week,stick this code on a command button:

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Dim stAppName As String
Dim tiffName As String

'this will look up the record name from the current record.
tiffName = "c:\testfolder\" & Me!ipsisID & ".tif"

'the location of the explorer.exe may vary depending on operating system.
stAppName = "C:\winnt\explorer.exe " & tiffName
Call Shell(stAppName, 1)

Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top