Hyperlink Repost

P

Pam

Hi,

I recently posted the message below and someone asked me to enter the code I
am using and I did, but they never replied back. I'm posting again in the
hopes that someone will have answer.

First Message:

I have a DAP set up to review list of literature on hand. I need to have a
button set so that when clicked it will open pdf file located on server for
item number of literature for each record. I can get it to the file where
all the pdf's are located, but I cannot figure out the code for "where item
code = name of individual pdf file".

If anyone can help, I would greatly appreciate it. I have this working in a
regular Access form, but not for the DAP.

Thanks in advance,
Pam

Second Message with Code:

Thanks, Ken, for replying. Here is the code I'm using on a regular form. I
realize it won't be the same for the data access page. If you provide code
that will work like the regular form, I would certainly appreciate it. I've
spent a considerable amount of time trying various code and researching.

Private Sub Command21_Click()
Dim strPath As String

strPath = "\\dell4\databases\PDF\" & Me.[ITEM NUMBER] & ".pdf"
If Dir(strPath) = "" Then
MsgBox "There is no pdf for this brochure."
Else
Application.FollowHyperlink strPath
End If

End Sub

Thanks again,
Pam
 
M

Mark A. Sam

Pam,

Did you stop the code after the StrPath assignment

strPath = "\\dell4\databases\PDF\" & Me.[ITEM NUMBER] & ".pdf"

to see its value".Maybe it is simply a syntax problem.

Also, after assigning StrPath a string value, it won't be "" on the next
line. It would at least be \\dell4\databases\PDF\ .pdf, if [ITEM NUMBER]
was "".

God Bless,

Mark A. Sam
 

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

Similar Threads


Top