Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Displaying photos on a subform

Posted on 2011-03-18
15
Medium Priority
?
509 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 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
 [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

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

782 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