Basically, I need to do (with VB code) what the InsertObject action on a
bound OLE Object field does.
I've tried GetObject, LoadPicture and AppendChunk methods in various
combinations, as well as reading the .bmp file in binary mode into a string.
The best I can do so far is to get the data into the field (in "Picture"
class
format), and display it in an Image control by setting it's PictureData
property, in the OnCurrent event.
Does anyone know of a way within Access 97 to do this, or do I need to
get some additional add-on software (e.g. developer's toolkit?)
Regards,
Martyn Webster
Principal Consultant
FIRST STRIKE SOLUTIONS
PO Box 993 Toronto NSW 2283 AUSTRALIA
http://www.firststrike.com.au
Set Forms!Orders!OLECustomControl.Picture = LoadPicture("Stars.bmp")
Of course, I would never try this without specifying the full path.
Too many could to go wrong otherwise.
That's the crux of the problem - I can get a picture from a
.bmp file to a Form Control using LoadPicture, or copy an
object from one Field to another using GetChunk/AppendChunk.
What I *can't* do is to read the .bmp file and put it into
an "OLE Object" Field (as an embedded bitmap object).
Regards,
Martyn Webster
FIRST STRIKE SOLUTIONS
PO Box 993 Toronto NSW 2283 AUSTRALIA
Web: http://www.firststrike.com.au
rs1!PhotoData = tempFrameCtl.OleData
It's good enough for my purposes this time, so thanks for
your suggestions - they got "near enough to be good
enough".
I'm still interested if anyone can find a way to do this without
needing to use an open form as a workspace.
If you download the Access 2000 version, be aware that it is in need
of update: the string variable used to hold the image in the BLOB
method should be changed to a byte array. I have an update, but have
been away from my high-speed connection, so haven't uploaded it. I'll
get it uploaded as soon as I return to my home base.
"Martyn Webster" wrote