Re: link to a pdf
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 16:08:46 -0400
"rml" <rml@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:934D672F-5CB7-493F-B1B8-F78D13386973@xxxxxxxxxxxxxxxx
How can I create a command button that would open or link to a pdf depending
on the Part Number field value?
If Part Number equals abc123 then open abc123.pdf, if no corresponding pdf
exists, then display some text , "not available". The pdf would be located
in the c:\drawings folder.
For example:
'----- start of (untested) example code -----
Private Sub cmdViewPDF_Click()
Dim sPartNo As String
Dim sPDFName As String
Const conDrawingFolder As String = "C:\Drawings\"
sPartNo = Me![Part Number] & vbNullString
If Len(sPartNo) = 0 Then
MsgBox "There's no current part number!"
Else
sPDFName = conDrawingFolder & sPartNo & ".pdf"
If Len(Dir(sPDFName)) = 0 Then
MsgBox "No drawing is available for this part."
Else
Application.FollowHyperlink sPDFName
End If
End If
End Sub
'----- end of example code -----
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- References:
- link to a pdf
- From: rml
- link to a pdf
- Prev by Date: Re: how do I run an event on a form that spawns a popup after pop is closed?
- Next by Date: Re: Cumulative cost
- Previous by thread: link to a pdf
- Next by thread: Re: Memo Zoom Box
- Index(es):