Click to See Complete Forum and Search --> : [RESOLVED] MS Access database - Input an image
OllieVB
Jan 24th, 2006, 02:02 PM
Hi,
I've created a database that stores details for a car club. It's been in use for a while and I thought I would try out some extras. The main thing I would like to add is the facility to include a picture of each member's car in their records. How do I create an image box where the image can be selected by the user and it's path stored in their record for future display, bearing in mind the user has no access to the code?
DKenny
Jan 24th, 2006, 02:19 PM
Do you want the user to have the ability to upload a picture of their specific car to the database or do you want them to select an image from a set of images that you already have?
RobDog888
Jan 24th, 2006, 03:33 PM
You will need to use an Image control to display the picture. Then link it to your tables field for it. The field should be an OLE Object type.
OllieVB
Jan 25th, 2006, 03:42 AM
Firstly, the idea is to be able to go into the member's record, click on the picture space, select an image that's already on the PC using a file selector dialog box (jpg files only) and have the picture come up in the box. At this stage, I'm not bothered about scaling. Also, I'm not sure if it's better to have the image linked or embedded.
Forgot to mention... I have already set up an OLE Object field (called 'oleImage') and it's already on the record form. Just need to know what to do with it!
maperry
Jan 26th, 2006, 03:16 PM
I tried a couple of ways to get a picture off of the HDD and insert it into a record. I couldnt figure out how to do that. What I ended up doing is leaving the field on the form and just letting the user copy/past the desired picture directly into the field.
I was never able to find a way to use the INSERT or UPDATE statement to get a file from the disk and put it in a table. At one point I tried reading the picture file itself, but the file headers differed too much from one compression to another to work out for me in the time alotted.
Edit: You might try a series of macros that copy/paste into a selected record.
Couple of pointers I have for this task: Make sure that you take precautions on file size. Picutes can be unnecessairly large, and moving those pictures around will bloat your database.
Since your pictures are going to be dynamically updated via some user operation, you'll be linking them.
OllieVB
Feb 6th, 2006, 04:20 AM
Found another way to handle it. As I didn't need to embed the images, I created a blank image box on the record form and had a hidden field holding the path to the image required. When the image is clicked, a common dialog box appears that allows this path to be changed. Whenever the form is loaded or altered, it checks to see if the path is set and if so alters the property of the image. It works a treat!
Thanks for the help anyway guys!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.