Insert the PDF activeX control and name it "viewer".
Make sure you add the Adobe OLE reference ("adobe"), if not the code will be undefined.
Code:
Private Sub cmdView_Click()
Dim AcroApp As CAcroApp
Dim AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc
Set AVDoc = CreateObject("AcroExch.AVDoc")
Set AcroApp = CreateObject("AcroExch.App")
Set PDDoc = AVDoc.GetPDDoc
thank you, with a little try and error I got it working.
I have updated the sample db with the code
Code:
Private Sub AcroPDF5_GotFocus()
Me.AcroPDF5.LoadFile ("D:\ResMed Reports\12 to 19May 2014.pdf")
End Sub
This works if you only want that pdf file to be shown, I have different 2 pdf's for each new form created,
On the sample db you can do it to a text box using code