Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Location
    Houston, Texas, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    picture into field via code (Access 2003)

    I need to get a picture into an OLE object field in one of my tables. Is there a way to do this with an update query? If not, can anybody point me in the direction to do this with code?

    Thanks,

    deutsch

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture into field via code (Access 2003)

    It is not a good idea to store images in an OLE field. It will cause your database to grow tremendously in size, for Access stores an uncompressed bitmap of each image. The recommended approach is to store the path and filename of the image in a text field in the database, and to use a standard image control (not an unbound OLE control) and some VBA code to display the image. The database attached to <post#=296892>post 296892</post#> demonstrates how to do this in a form and in a report. The images can be .bmp, .jpg, .gif, .png, .wmf, .tif and several other graphics formats.

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Location
    Houston, Texas, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: picture into field via code (Access 2003)

    Thanks, Hans. The problem is the database is sent to the printer to pint a catalog. The catalog has icons for the various storage types. Right now they are linked. Just this one time I need to get the object into the field.

    deutsch

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture into field via code (Access 2003)

    I don't think you can use a query for that, it'll have to be code, but I only know how to do this in a form:

    With Me.OLEControl
    .SourceDoc = "F:PicturesCarton.gif"
    Action = acOLECreateEmbed
    End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •