Results 1 to 4 of 4

Thread: Simple access Q

  1. #1
    Join Date
    Dec 2005
    Posts
    11

    Unanswered: Simple access Q

    hi,

    i have a database which is 13000kb that should only be about 3000(by comparing it to similiar dbs).

    i did have a lot of images in the tables that i deleted but it doesnt seem to have saved space.

    Also is there any way of linking images into a table,to save space. i tried using a bitmap image then linking it to a file but then when i bring it up in a form its just the icon of the file and not the actual image itself.


    Any ideas.
    Last edited by vancottier; 12-13-05 at 06:55.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    store the path to the image
    place an image control on your form
    in the forms on current event place some code which calls an assignment function
    in the control (containing the path) place some code which contains a call to the same function. the choice of events is up to you (couild be lost focus, on change etc..)

    your assignment function should check that the image exists before assigning it. you can also use the "on error" error trapping to handle the missing file. It may also be 'smart' to either hide the image if file not found, alternatively always insert a blank image prior to trying to assign the new image. (I've often used a blank image which says 'Image not found' as a place holder.

    to recover the sapce in your db try tools | database utilities | compact & repair

  3. #3
    Join Date
    Dec 2005
    Posts
    11
    excuse my ignorance but i have a candidate table and want to have a picture for each candidate on a candidate form. what would the function be??

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    function SetImage(<pathtoimage>
    with <myimagecontrol>
    on error goto imagenotfound
    .image=<pathtoimage>
    onerror goto 0
    end with
    exit fucntion
    imagenotfound:
    'insert any error handler
    'could be
    <myimagecontrol>.visible=false 'if you go down that route remember to set to visible after you have set the image
    resume next
    exit function

Posting Permissions

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