use VB to store data in OLE field

M

Michelle K.

I need to fill an OLE object field using VB -- when the user clicks a button,
the value of the OLE object field needs to change to be a bitmap image. I
have created the files for the images I need -- I'm looking for the code to
basically say Forms![image field]= image file. Also, loading the OLE field
manually into the table I get "Package" in the field instead of "Bitmap
Image" if I right-click, then choose "from file" instead of "create new" --
Package puts a black box on the form, Bitmap Image displays the colored bar I
need. Any help would be greatly appreciated.
 
M

Maarkr

instead of using an OLE object, it may be better to store the link in your
field, use an empty image box on the form, then use some code like
Me.Image29.Picture = "C:\Documents and Settings\picture.bmp"
 
M

Michelle K.

Thanks for the response. I'm using continuous forms so I'm thinking that the
use of the Picture property will not do what I need. I did find a solution
to my original problem -- setting different background colors for different
rows on the form based on a value in one field (too many for conditional
formatting) -- by linking a table that contains fields for just the code and
a bitmap image of the color I need to the data table. Works wonderfully and
seems pretty simple now that it's put together -- and doesn't take up hardly
any more room than without the coloring.

Again, thanks for posting -- this forum is very helpful!

Maarkr said:
instead of using an OLE object, it may be better to store the link in your
field, use an empty image box on the form, then use some code like
Me.Image29.Picture = "C:\Documents and Settings\picture.bmp"

Michelle K. said:
I need to fill an OLE object field using VB -- when the user clicks a button,
the value of the OLE object field needs to change to be a bitmap image. I
have created the files for the images I need -- I'm looking for the code to
basically say Forms![image field]= image file. Also, loading the OLE field
manually into the table I get "Package" in the field instead of "Bitmap
Image" if I right-click, then choose "from file" instead of "create new" --
Package puts a black box on the form, Bitmap Image displays the colored bar I
need. Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top