Solved

Displaying photos on a subform

Posted on 2011-03-18
15
498 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 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

636 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