Coding SourceDoc in unbound object frame

J

JP

I have a form with both a text field (txtPDFname) of filename location (eg:
c:\documents\testgrades.pdf) as well as an Unbound Object Frame (OLEpdf).
I have been unable to code a button which will then enter in the SourceDoc
property of the Unbound Object to the variable location of the different
files I wish to show in the unbound object frame.
------- my code for the button: -----------
Private Sub cmdPDFview_Click()
Dim strFilename As String
strFilename = Me![txtPDFname] ' [txtPDFname] shows the path of the file.


Me![OLEpdf].Locked = False
Me![OLEpdf].SourceDoc = strFilename
Me![OLEpdf].Action = acOLECreateLink
End Sub
 

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

Top