Open files from Access Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

One field of my table contains a link to an attached file. This file may be
a word doc, pdf, or other.

How could get Access to open the file using the appropriate program (ie
Word, Acrobat..etc) automatically when I click a button.

I know how you could specify a particular program, say word, to open a
link... But not sure how I could do a pdf. And how I could get it to
determine default program settings.

Thanks for your help.
 
Hello all,

One field of my table contains a link to an attached file. This file may be
a word doc, pdf, or other.

How could get Access to open the file using the appropriate program (ie
Word, Acrobat..etc) automatically when I click a button.

I know how you could specify a particular program, say word, to open a
link... But not sure how I could do a pdf. And how I could get it to
determine default program settings.

Thanks for your help.

You don't need to specify the program. The file extension will
determine what program opens the file.

For example, code the click event of a command button:

Application.FollowHyperlink "PathToFile\FileName.pdf"

The .pdf extension will cause the file to open with Adobe Acrobat.
 
Hello all,

One field of my table contains a link to an attached file. This file may be
a word doc, pdf, or other.

How could get Access to open the file using the appropriate program (ie
Word, Acrobat..etc) automatically when I click a button.

I know how you could specify a particular program, say word, to open a
link... But not sure how I could do a pdf. And how I could get it to
determine default program settings.

Thanks for your help.

Consider storing Hyperlinks to the files. Windows will open the appropriate
program for the file type.

John W. Vinson [MVP]
 
John
How would I do that? And what would be the "open" command?

Fred
Does this command work if the filepath is stored as a text?
 
John
How would I do that? And what would be the "open" command?

Two for the price of one today?
You can store the path and file name as a Hyperlink field.
Look up Hyperlink in Access Help.
Clicking on the field will open the file.

Alternatively, you can store the path and file name as a Text
datatype.
Then code the double-click event to open the file using the
FollowHyperlink method.
Fred
Does this command work if the filepath is stored as a text?

Application.FollowHyperlink [Name of Control that stores the Path] &
"\MyFile.pdf"
 

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

Back
Top