Hi,
I have a basic test form that includes a field containing the location and name of a PDF file that I want to display in an OLE object on the form; I use the following form to display the PDF file as I scroll through the recordset:
Private Sub Form_Current()
Me.olePDF.SourceDoc = Me.sFilePath
Me.olePDF.Action = acOLECreateLink
End Sub
This works perfectly on the form, however when I try to produce the same output on a report I get the following error:
Run -time error '2771': The bound or unbound object frame you tried to edit doesn't contain an OLE object.
I am sending the name of the OLE Source Doc to use via the .OpenArgs parameter, but the code is falling over at the acOLECreateLink line:
Private Sub Report_Open(Cancel As Integer)
Dim sFile As String
sFile = Me.OpenArgs
MsgBox sFile
Me.sFilePath.Caption = sFile
Me.olePDF.SourceDoc = sFile
Me.olePDF.Action = acOLECreateLink
End Sub
Any help would be much appreciated!
Liz