Thanx MajP for the response. I need to elaborate. I'm storing photos on my HD and I have links to those photos in the db to conserve space and speed. If I get a group of say 20 photos and download them to a file, can I view / select them via a combo box? Currently I only see renaming each one and creating a separate link for each one. I'd rather treat them as a group. Is that possible?
This is no longer true. In access 2007 they provide an bound image control for just this purpose. All you have to do is put in the data source the field that holds a full text path to the image and it renders. It is a pretty significant improvement, yet for some reason there is little documentation. It is like friggin magic. There is absolutely no reason in my mind to write code anymore or use a bound object frame.
Now in 2007 and later you also have an attachment field. If you attach each picture to a record it will allow you to have a single record and view the multiple images.
But if I understand you correctly you would like to have multiple images saved in a folder, and have a record with a link to the folder. Then in a single form view be able to see all the images in that folder. Is that correct?
If that is the case you would need to add some code to the on current event. In the on current event you would go to the related folder, read all the contained image files and store the path in a combo or listbox. Then when you click on a row in the combo or list then you could run the code you are using to display in the control. If it was me I would probably not use a combo or list, but have a child table. I would use a folder dialog. When adding new images to a record I would browse to the folder. It would add all images in the folder as paths in the child table. Now you could have a simple image control bound to the table and have arrows to move through the images. It could be a subform on the mainform. I would also have the option to "add from file" or "add from folder". Similar to ITunes.
To show how cool the new image control is, here is something you may want to consider.
So assume you are able to populate a table of paths to pictures that relate to a parent table. In this case there are three images related to record 1 of the parent and 2 related to parent record 2.
1) Build a continous subform of the images using a bound image control with a source of the field "path"
2) Put this on the main form linked by ParentID
3) On the main form also put an image control. Call it "imgOne"
4) Add this code to the subform
Private Sub Form_Current()
Me.Parent.imgOne.Picture = Me.path
End Sub
Now when you change a record on the main form it shows all the related images in the subform. When you click on a subform images it shows a larger image on the main form of the selected image.
Doing this prior to 2007 would have been extremely difficult. Now it happens with one line of code. Pretty cool.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.