Problem opening PDF files by setting command button HyperlinkAddre

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

Guest

Hi,

I have a command button which I set the HyperlinkAddress property in the
click event. When the variable that contains the file locations is a .HTM
file then everything works fine and the htm file is opened and displayed.
But when the file is a .PDF file the link does not work. When I press the
command button I see the adope icon appear for a brief moment in the taskbar
but then it is gone and I am back in access. Any ideas while this is not
working with PDF files?

Here is the code I have for the command buttons click event........

If Not IsNull(Me.P_DOC_LOC) Then
Me.open_doc_cmd.HyperlinkAddress = Me.P_DOC_LOC
Else
Me.open_doc_cmd.HyperlinkAddress = ""
End If

Thanks very much,
Doug
 
Try using the got focus event rather than the click event for the button.
It's odd, but frequently works.
 
Hi Doug,

1) Do the same PDF files open correctly when you double-click on them in
Windows Explorer? If not, reinstall or repair Acrobat reader.

2) Copy the contents of P_DOC_LOC. Then hit Ctrl-G to open the Immediate
pane, then try executing

Application.FollowHyperlink "<paste the filespec here>"

Does that work?

3) There seems to be a problem if you take a filespec that contains a
hash # character and treat it as a hyperlink. Is it possible that the
PDF files you've been testing have # in their path?
 
Back
Top