linking command buttons to other files

J

Jessica

Hello All,

I have a form with several command buttons linking to several spreadsheets
and documents located in other folders on the company server. I did this by
using the path name for each file as a hyperlink address. Is this the
correct way to do this or is there a more efficient way.



TIA,
Jess
 
T

Tom Wickerath

Hi Jessica,

Your method sounds okay, as long as there are not too many such documents.
If you have 20 similar command buttons on a form, all of which open linked
spreadsheets or Word documents, then the appearance on your form might get a
bit crowded looking, to say the least.

A possible alternative, if you have lots of documents, is to store the full
path to each document in a table. Have another field that give a short
description (say 20~25 characters or less). Include a primary key field.
Something like this:

tblDocuments
pkDocumentID (Autonumber primary key)
DocShortDesc (Short description, 20~25 characters max.)
FullPath (Full path to the document).

You might also want to break the FullPath field into two fields: Path and
Filename. You should use the UNC representation (ie. \\server\share instead
of a mapped drive letter) to store the path. There is code available to
convert mapped drive letters to the UNC equivalent.

You could then have a combo box on a form, or a listbox with multiselect set
to none, that would display only the DocShortDesc to the user. When they
selected a document, and pressed a command button (perhaps labelled "&Open
Document"), the selected document would open.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Hello All,

I have a form with several command buttons linking to several spreadsheets
and documents located in other folders on the company server. I did this by
using the path name for each file as a hyperlink address. Is this the
correct way to do this or is there a more efficient way.



TIA,
Jess
 
J

Jessica

Very well explained Tom thank you so much. I was thinking after setting up a
few command buttons like I have that it would look kind of cluttered. Thanks
again for the suggestion I will give that a try instead.

Jess
 
Top