Solved

Displaying photos on a subform

Posted on 2011-03-18
15
485 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 35166758
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
ID: 35166784
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
ID: 35166927
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 75
ID: 35166958
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
ID: 35166995
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
ID: 35167265
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
ID: 35167857
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
 

Author Comment

by:gcgcit
ID: 35167922
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
ID: 35168009
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
ID: 35168142
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
ID: 35181805
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
ID: 35192224
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
ID: 35195024
I don't have A2010 or A2007.  I need an mdb file - A2003
0
 

Author Closing Comment

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

Expert Comment

by:GRayL
ID: 35242437
Thanks, glad to help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

828 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