Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding OLE object in a table using VBA

Status
Not open for further replies.

RobWalls

Programmer
Jul 25, 2001
15
0
0
GB
I am trying to embed an OLE object in one of the fields of a table using code in a module. I have done this from a form before, but don't know how to do it in this context. The only thing i've found is shown below (given that i have a field called Jpeg which takes OLE objects);

Dim rstMain As DAO.Recordset

Set rstMain = CurrentDb.OpenRecordset("tblMain")
With rstMain
.AddNew
!Field1 = "New Data"
!Field2 = "More New Data"
!Jpeg.CreateEmbed "C:\Windows\Circles.jpg"
End With

rstMain.Close


but .CreateEmbed threw up the error "Method or Data Member not found". Any ideas what i need to do? By the way, i am using Access 2000.
Thanks in advance for your help,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top