I am trying to show an image (.tif) file in an OLE object when a related record is selected from a database table. The database table has a field called DOC_NUM which is the same as the file name of the .tif image. I can show the first such image, the Sourcedoc of the OLE object, when I initiate the program, but I can't select the appropriate file at run time. I get an error: 31037; 'Contents of the OLESTREAM not in correct format'.

This is the code I use to load the file:

fNum = FreeFile
With RecordsetName
fImage = (driveath) & !DOC_NUM & ".tif"
End With
Open fImage For Binary As #fNum
OLE1.Class = "WangImage.Document"
OLE1.ReadFromFile (fNum)
Close #fNum


Any ideas?