Open pdf or tif file from Access 2003 Form

  • Thread starter Thread starter Dave Couch
  • Start date Start date
D

Dave Couch

I want to be able to dbl-click on a field that shows a file name, tif or pdf,
and go to that file and open it the same as you would do if you dbl-clicked a
file in Windows explorer. The entire file name would consist of 2 fields,
the folder and the file name. Any help would be greatly appreciated.
 
Ifd you make it a hyperlink to the full path of the file, it will open with
whatever program is registered to open that file extension.

-Dorian
 
I want to be able to dbl-click on a field that shows a file name, tif or pdf,
and go to that file and open it the same as you would do if you dbl-clicked a
file in Windows explorer. The entire file name would consist of 2 fields,
the folder and the file name. Any help would be greatly appreciated.

Does the Pathfile field include a final backslash character, i.e.
"c:\MyFolder\"?
Does the FileName field include the file type extension, i.e.
"FileName.pdf"?

If Yes on both, code the Double-click event of either or both
controls:
Application.FollowHyperlink [PathFileControl] & [FileNameControl]

If it does not include that final backslash and/or the extension,
then:
Application.FollowHyperlink [PathFileControl] & "\" &
[FileNameControl] & ".pdf"
 
Fred, thanks very much for the help. That was exactly what I was looking
for. After a number of times correcting my typos, it worked perfectly.

fredg said:
I want to be able to dbl-click on a field that shows a file name, tif or pdf,
and go to that file and open it the same as you would do if you dbl-clicked a
file in Windows explorer. The entire file name would consist of 2 fields,
the folder and the file name. Any help would be greatly appreciated.

Does the Pathfile field include a final backslash character, i.e.
"c:\MyFolder\"?
Does the FileName field include the file type extension, i.e.
"FileName.pdf"?

If Yes on both, code the Double-click event of either or both
controls:
Application.FollowHyperlink [PathFileControl] & [FileNameControl]

If it does not include that final backslash and/or the extension,
then:
Application.FollowHyperlink [PathFileControl] & "\" &
[FileNameControl] & ".pdf"
 
Fred, thanks again for the previous info. Now I am trying to do the same
thing from a sub-form. I have the references for the file name and location,
but I think I need to reference the form that the fields are in. The problem
is, I don't know the syntax for referencing the form name. The form name is
"frmCountySearch" and the field names are "filelocation" and filename". They
contain the slashes needed for the paths. Can you show me the correct
syntax?? It would be much appreciated.

fredg said:
I want to be able to dbl-click on a field that shows a file name, tif or pdf,
and go to that file and open it the same as you would do if you dbl-clicked a
file in Windows explorer. The entire file name would consist of 2 fields,
the folder and the file name. Any help would be greatly appreciated.

Does the Pathfile field include a final backslash character, i.e.
"c:\MyFolder\"?
Does the FileName field include the file type extension, i.e.
"FileName.pdf"?

If Yes on both, code the Double-click event of either or both
controls:
Application.FollowHyperlink [PathFileControl] & [FileNameControl]

If it does not include that final backslash and/or the extension,
then:
Application.FollowHyperlink [PathFileControl] & "\" &
[FileNameControl] & ".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