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

  • Thread starter Thread starter Access Newbie
  • Start date Start date
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?
 
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.
 
Back
Top