Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying photos on a subform

Posted on 2011-03-18
15
Medium Priority
?
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 1000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

704 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