Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Posts
    108

    Unanswered: Using image stored in table for form's control?

    Can you do that? In pseudo:

    SomeForm.desiredimage.picture = DLookup( "[PictureStoredInTable]", "Members", somecriteria)


    The reason to do this is instead of using path is:
    - to have all pictures inside database and not in outside files
    - database is used over many network computers so path to the files is different and mostly doesn't work

    Thanks.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Yes you can use image files stored in the table but I might suggest (if you must do it this way), that you don't utilize the dlookup directly for the form's control as I think you'll have problems with setting the .picture using the dlookup of an image. You can possibly try storing the dlookup value to variable (image type) first and then set the .picture to the image type variable. I'm not sure if this would work but that's what I might try.

    Otherwise, try to create your form so it uses the image into a bound field based on the recordset with the image type field versus using an unbound field and a dlookup to populate the .picture of a form's control. This would be ideal as even if you did get the dlookup to work, I think it would be fairly slow on any good size recordset of images.
    Last edited by pkstormy; 10-21-09 at 22:15.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by Riorin
    The reason to do this is instead of using path is:
    - to have all pictures inside database and not in outside files
    - database is used over many network computers so path to the files is different and mostly doesn't work

    Thanks.
    theres no substantial advantage in stroing images inside the db.. its been covered before but there are some problems.
    namely your db bloats unnecesarily, storing mostly static data.. makes backup longer, will generate more network traffic especially if you use select *

    as to
    so path to the files is different and mostly doesn't work
    thats almost certainly down to you not correctly specifying the the path.... instead of using a drive eg zath/to/file.jpg you should be using a URL such as //servername/path/to/file.jpg
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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