matt beamish
Registered User.
- Local time
- Today, 19:25
- Joined
- Sep 21, 2000
- Messages
- 215
Hi people,
I've been working at this for too many hours in my amateurish way, and it's turned into:banghead:. I have searched for bits of code to copy other people better than I, and had some success but I am failing to complete, so it is now time for me to visit you all.
I am trying to open a PDF from a button on a subform. The location of the PDF is specified in a field. I want to open the PDF and search for a Member ID criteria also listed in a field on the Form.
This is my code:
In my Immediates I get
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"; False; \\uol.le.ac.uk\root\departments\ULAS\WebAccess\LAHS\2014\201409_Mailmerge_Final\LAHS_HistorianNewsletter.pdf
Adobe Reader reports "There was an error opening this document. The file cannot be found." but then opens the file (that's something).
So it's the "search" bit that is the problem, and I cannot for the life of me get my search parameter to be used.
Help appreciated, thanks
I've been working at this for too many hours in my amateurish way, and it's turned into:banghead:. I have searched for bits of code to copy other people better than I, and had some success but I am failing to complete, so it is now time for me to visit you all.
I am trying to open a PDF from a button on a subform. The location of the PDF is specified in a field. I want to open the PDF and search for a Member ID criteria also listed in a field on the Form.
This is my code:
Code:
Private Sub Text12_Click()
Dim strPath As String
Dim Searchmem As String
strPath = [Notetxt]
Searchmem = [MemID]
pat1 = """C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"""
pat2 = " /A " & Chr(34) & search = Searchmem & Chr(34)
pat3 = strPath
Debug.Print pat1 & "; " & pat2 & "; " & pat3
Shell pat1 & " " & pat2 & " " & pat3, vbNormalFocus
End Sub
In my Immediates I get
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"; False; \\uol.le.ac.uk\root\departments\ULAS\WebAccess\LAHS\2014\201409_Mailmerge_Final\LAHS_HistorianNewsletter.pdf
Adobe Reader reports "There was an error opening this document. The file cannot be found." but then opens the file (that's something).
So it's the "search" bit that is the problem, and I cannot for the life of me get my search parameter to be used.
Help appreciated, thanks