File Attachments

wiltshire

Registered User.
Local time
Today, 11:02
Joined
Feb 25, 2003
Messages
79
I am developing a database to control the documentation system within my company. It will control the procedures and who they are issued to.
I would like it to hold links to all procedures within our system. Is there any way of linking to Word files from within the database, and would this have to be done in a table or form?
I would like a datasheet view, listing all procedures, with links from each ideally.

Thanks
 
Your best bet would be to create a new field in your table and set it as a Hyperlink.

To create the link simply right click your mouse on the field (either in form or datasheet view) select edit hyperlink and then select browse to find your document.
 
Thanks MJDavie,

I've tried this already. It works fine if you know the name of the file and have one button per file.
However, I need the button to be on each line of the form in 'Continuous Forms' view. The click of the button opens the file with the same name as a file on the line.
 
File Attachment

try inserting a button and on the on click event use the following code:

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE " & [Test]
Call Shell(stAppName, 1)



Substitute Test for the name of the field that holds the path to the document.

Also you may have to change the path to run Word.

Hope this works
 
Thanks for the advice. I typed in the following code into the on click thingy:

Private Sub test()

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE " & [Title]
Call Shell(stAppName, 1)


End Sub


But no joy - it didn't do anything. Did I do anything wrong?
 
File Attachment

Make sure that the path is correct to open word and secondly the title field must contain the full path of the document to be opened e.g

C:\Procedures\Document1.doc

apart from that I can't see much wrong with it
 
It's me again !

I can't get this code to work - please excuse me being a VB cabbage !

I have the following code running off the 'on click' property of a button which appears on each line of a form in 'continuous forms' view:

Private Sub test()

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE " & [Title]
Call Shell(stAppName, 1)

End Sub


I've entered "C:\Program Files\Microsoft Office\Office\WINWORD.EXE " in to the Start\Run thingy and it opens Word, so that's correct.

I've knocked up a simple database to test it. Just one table with one field called [Title]. This hold 2 records, "c:\Steve\Test 1" and "c:\Steve\Test 2". These records correspond to two files held in these drives. I've also entered the paths into the Start/Run thingy and they open ok.

So, not sure what to do now. Do I need any extra code, as this is all the coding in the database at the moment?

Any help would be great.
 
File Attachment

The path c:\Steve\Test 1 must include the .doc file extension

i.e c:\Steve\Test 1.doc

Are you getting any error messages when you click the button?
 
Sorry - the Title field does contain the '.doc' extension.

When it runs, clicking the button gives a 'Run Time Error 53 - file not found' error message. Choosing debug shows the code with 'Call Shell(stAppName, 1)' highlighted in yellow.
 
File Attachment

Sounds to me that the path to open Word is incorrect.

Do you have a shortcut to open word on your desktop ? If so make sure it is working then right click and check it's properties.

The path that you can see there is the one that you should be using in your code.
 

Users who are viewing this thread

Back
Top Bottom