Open OLE object (1 Viewer)

aikea

Registered User.
Local time
Today, 03:17
Joined
Aug 4, 2007
Messages
58
I got this program in my project. The "TestFile" is a table with only two fields.

The "ID" field and a "FileName" field which stores OLE object.

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Source = "SELECT * FROM TestFile;"
rs.ActiveConnection = CurrentProject.Connection
rs.CursorType = adOpenDynamic
rs.LockType = adLockReadOnly
rs.Open

rs.Close
Set rs=Nothing

In the program "rs.Fields(1)" would be the OLE object, "rs.Fields(0)" would be the ID column.

Anyone know how could I display it in an unbound object frame?
 

Surjer

Registered User.
Local time
Today, 11:17
Joined
Sep 17, 2001
Messages
232
Create a control on your form and then populate it like this... (In my case it was a picture so I had a control Named Sketch...

Code:
[Sketch].OLETypeAllowed = acOLEEmbedded
[Sketch].SourceDoc = rs.Fields(1)
[Sketch].Action = acOLECreateEmbed
[Sketch].SizeMode = acOLESizeStretch
 

aikea

Registered User.
Local time
Today, 03:17
Joined
Aug 4, 2007
Messages
58
Thank you. Now it works.
 

Users who are viewing this thread

Top Bottom