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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Object load from file to Access Using Vb code???Very argent..

Status
Not open for further replies.

0000000001

Programmer
Dec 13, 2002
4
BD
HI,
I want to load OLE Object from disk(d:\p.bmp) that store "Access ole object field" as Bitmap Picture Using Vb code or Function instead of using "Access's Insert Menu or Dialog box". Using only vb code.
--Crystal Report easily known ole object fild(Bitmap Picture ) of Access
plz reply argent.
thanks.
Nazmul
 
There are several ways to do this with code. This uses an input box to insert the file name. I've found it easier to use a common dialog box to find the actual file on the pc and embed the file name. If you want the code from the other, I can provide. OLE1 is the name of the OLE field.
Private Sub OLE1_Enter()
Dim Retval As String
With OLE1
.OLETypeAllowed = acOLEEmbedded

Do
Retval = InputBox$("Type in the Full File Name", "Insert Bit Map Image")

Loop Until Len(Retval) > 0
If Len(Retval) > 0 Then
.SourceDoc = Retval
.Action = acCreateOleEmbed
End If

End With
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top