Solved

Displaying photos on a subform

Posted on 2011-03-18
15
456 Views
Last Modified: 2012-05-11
I'm using Access 2010.  I have a form that shows departments, the continous subform then displays all the employees details and photos in that department.

What is the best way to display a photo on a subform without bloating my database by using an OLE object?
0
Comment
Question by:gcgcit
  • 7
  • 5
  • 3
15 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
Comment Utility
You might want to consider this or at least be aware of if you are dealing with images in an Access database ... and I can totally vouch for this program.  
http://www.ammara.com   >>> DBPix ...

It does *all* the work for you. Examples show how to add a simple 'control' panel to Load, Save, Zoom In/Out, Size To Fit and much more.  AND ... virtually eliminates BLOAT associated with storing images in an Access MDB. I have 3 clients who sell commercial run-time products that use DBPix.

Note. I have no connection with DBPix ... except I have used it many times ...

mx
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
We also have this:

A database demonstrating how to use the Intel Jpeg library with Access. Jpeg files are stored in their original compressed state within a Binary OLE avoiding the Ole object "bloat" issue. Here is the A2K version
http://www.lebans.com/loadsavejpeg.htm

A database containing a class to enhance the standard Image control
http://www.lebans.com/imageclass.htm

mx
0
 

Author Comment

by:gcgcit
Comment Utility
No budget to buy add-ons.  Do you know of a control and code that I could use where I just reference the path of the image and it displays it in the subform (but isn't imported at all)?
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Did you check out the Lebans code ?

I really rarely work with images.  But others here do ....

mx
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
Create a small form with an Image control named imgPic - bound to the table containing a Hyperlink field MyHyperlink.  In the Current Event of the Form add this code.

Private Sub Form_Current()
  Me!imgPic.Picture = HyperlinkPart(Me!MyHyperlink, acAddress)
End Sub

You can scroll through the pictures using the record selector at the bottom of the form
0
 

Author Comment

by:gcgcit
Comment Utility
GRayL: do you have a sample database?  So many examples I find work with a mainform but not with subforms.
0
 

Accepted Solution

by:
gcgcit earned 0 total points
Comment Utility
I can't get this one to work with a subform (it was posted by an expert on this website), when I put this on a subform all the records show the same photo from the first record
Access-BasicLinkFormReportImages.mdb
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:gcgcit
Comment Utility
what ends up happening is when I add the photo to the first record, all records below it on the subform then have the same photo (even though these are bound fields)
ee-duplicatephotos.jpg
0
 
LVL 44

Assisted Solution

by:GRayL
GRayL earned 250 total points
Comment Utility
I forgot you specified subform - intuition tells me the following.  Create a small form as described above, bind it to your table and save it as frmPics.  In the subform control, make the Source Object property the same as that of the form - frmPics.  I don't know what you have in the main form, but this should let you scroll through the table on the subform.

I'll download your mdb now and have a look
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
I've downloaded and I do not see a subform on your main form.  I'm not sure I understand what you are trying to accomplish  between the main form and the sub form.  As I see it, frm Pics must be different from frmMain.  Care to elaborate?
0
 

Author Comment

by:gcgcit
Comment Utility
Sorry the database I provided was one an expert created to show me how to make photos work.  But I tried to incorporate their code into a subform and I can't get it to work.  I'll go create a sample database with a subform and then resubmit.
0
 

Author Comment

by:gcgcit
Comment Utility
Can you please review the 2010 Access Database sample provided.

I need the subform to display different photos for every person in the form form.  Right now if you add a new photo to the first person, it displays on all subsequent records as well even though when I go into the tables only that one record has a path to the image.

PLEASE HELP! I'm stumped!
ee-Pictures.accdb
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
I don't have A2010 or A2007.  I need an mdb file - A2003
0
 

Author Closing Comment

by:gcgcit
Comment Utility
Not completely solved but useful information provided by 2 experts.
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
Thanks, glad to help.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now