How to insert a bmp file into Access 2003 table using code

A

Access Newbie

I am trying to insert a bmp file into an Access 2003 table (ole object)
through using code in a module.

Does anyone have any coding examples on how to do this programatically?
 
F

fredg

I am trying to insert a bmp file into an Access 2003 table (ole object)
through using code in a module.

Does anyone have any coding examples on how to do this programatically?

Don't!
Store the .bmp image in a folder outside of your Access database.
In the database, store just the name of the image (as text, in a field
named, for example, "PhotoField"), i.e. ApricotJam.bmp

Then when you need to display the image, use an Image control.
On a form You can code the form's Current event:
Me.ImageName.Picture = "c:\PathToFolder\" & Me.[PhotoField]

Similar coding in the Report section's Format event would display the
picture in a report.

The important thing is to store the .bmp outside of Access to avoid
database bloat.
 

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