Image Gallery

ddrew

seasoned user
Local time
Today, 05:58
Joined
Jan 26, 2003
Messages
911
Hi, I wonder if someone could show me how to build an inage gallery in Access 2007 please.

I understand that the best place to store the picture is in its on folder which I have done for a single Profile Picture by naming the image the same as the Record ID.

But what do I do if I want to allow the user to add multiple images to a gallery?

I really have no idea how to go about this or even where to start!

What I would idealy like is a window at the top of the form that I could scroll along looking at thumbnails and then cli9cking on an image to display it larger on the form.

I know that Access 2010 has an Image Gallery but as I said Im 2007
 
OK, I'm reading that access as a photo album isnt very good, I still want to do it but inteand to limit the number of photos for a record to eight!

I can store a single image in a seperate file:
Code:
ImageFileSnap1: "C:\Databases\Images\Snaps\" & [Dog_ID] & ".jpg"

With this I have one image control which is fine but it means nameing the image the same as the Dog_ID. My idea is to have eight image controls on a form, each one using the Dog_ID and the image being named the same except each contol would be looking for the Dog_ID + a or b or c etc.

So my question is; firstly is it possible and secondley where do I put the extra charcter (a, b, c etc) in my image control query??

I tried this
Code:
ImageFileSnap1: "C:\Databases\Images\Snaps\" & [Dog_ID] [COLOR="red"]+[a] [/COLOR]& ".jpg"
but it didn't work!
 
Perhaps one option would be something like this:

Create a table and add to fields

ImageID (AutoNumber) and txtIMageName (Text)

Add the path and image names into the table (single Line Entry).

Create a Form and use the table then add the ImageFrame. Open the properties of the Frame and place in something on the control source Like [C:\Windows\Zapotec].bmp

Create a function like this

Function setImagePath()
Dim strImagePath As String
On Error GoTo PictureNotAvailable
strImagePath = Me.txtImageName
Me.ImageFrame.Picture = strImagePath
Exit Function
PictureNotAvailable:
strImagePath = "M:\NoPicture.BMP"
Me.ImageFrame.Picture = strImagePath
End Function

Then in the form event for On Current use this =setImagePath()

When you navigate to each record you should see a picture from your folder.
 
Perhaps one option would be something like this:

Create a table and add to fields

ImageID (AutoNumber) and txtIMageName (Text)

Add the path and image names into the table (single Line Entry).

Create a Form and use the table then add the ImageFrame. Open the properties of the Frame and place in something on the control source Like [C:\Windows\Zapotec].bmp

Create a function like this



Then in the form event for On Current use this =setImagePath()

When you navigate to each record you should see a picture from your folder.

Cant really do it this way as the user will have to put the paths in, I really want to keep it as it is with each imagecontrol looking for Dog_ID + a or Dog_ID + b etc
 
OK, so I've come up with a soloution! I created a folder C:\Databases\Images\Snaps\1 and then created 8 more and numbered them accordingly, so nine in all. Made a query with 9 statements:
Code:
ImageFileSnap1: "C:\Databases\Images\Snaps\1\" & [Dog_ID] & ".jpg"
Each one being named appropriately. All the user has to do is identify the Dog_ID from hi/her profile drop the pics into the appropriate folder and rename them to appropriate Dog_ID. Probobley not as efficient as it could be, but it works fine!
 
OK, so I've come up with a soloution! I created a folder C:\Databases\Images\Snaps\1 and then created 8 more and numbered them accordingly, so nine in all. Made a query with 9 statements:
Code:
ImageFileSnap1: "C:\Databases\Images\Snaps\1\" & [Dog_ID] & ".jpg"
Each one being named appropriately. All the user has to do is identify the Dog_ID from hi/her profile drop the pics into the appropriate folder and rename them to appropriate Dog_ID. Probobley not as efficient as it could be, but it works fine!
I was about to suggest that before noticing this post. This is the way I would do it so good job ddrew!
 
I know I'm going to be pain but I would do it the other way round C:\Databases\Images\Dog_ID\

As you have already identified the dog there is nothing to then stop you just calling the images:
1.jpg
2.jpg
3.jpg etc

The simple reason all the images for that dog are grouped together and can be seen in one directory. I do this all the time but not with multiple images. I can easily identfy images that are, in your case, the wrong dog.

Variations on a theme:

Create a table Dog_ID\ImageNo\
Put this into a Continous Form on whatever Form.

Just a cautionary tale, with over 16,000 unique images it was hard enough to get the users to deal with the images properly - size and resolution. So don't make a rod for your own back!

Access gets a little irritated with 2MB files heaven knows what it would do with one of the 48MB Master images.

Simon

Simon
 

Users who are viewing this thread

Back
Top Bottom