Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image path

Status
Not open for further replies.

hoofit

Technical User
Nov 20, 2005
343
US
Good morning,
Can someone post a sample of how to get a photo(.bmp) path into a table other than manually typing it in.

Thank you

hoof
 
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?

Thank you
 
Maybe append a group of photos to a table.....
 
How are ya hoofit . . .

As far as display of these pictures in your db, are you talking [blue]single[/blue] or [blue]continuous[/blue] form?

and

In the form which picture object are you using ([blue]Bound Object Frame[/blue], [blue]Unbound Object Frame[/blue] or an [blue]Image Object[/blue])?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
hoofit . . .

Hit submitt too soon.

Be aware: [blue]continuous forms[/blue] are limited to [blue]Bound Object Frame[/blue].

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Sorry about the delay.....this is a single form. I dragged an image control to the form which links to a file on my hd
 
This is the method I used.

support.microsoft.com/kb/285820

Thank you
 
This question is very dependant on the version of Access you are on. If on 2007 or later there are many more options

AceMan said:
Be aware: continuous forms are limited to Bound Object Frame.

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.

path parentID
C:\a.jpg 1
C:\b.jpg 1
C:\c.jpg 1
C:\D.jpg 2
C:\E.Jpg 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.

qsp7j9.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top