Solved

Duplicate Photos on Subform.

Posted on 2011-02-19
10
878 Views
Last Modified: 2012-05-11
I have a subform that shows people's pictures.  there is a field called txtImageLocation that stores the location of the photo on my server.

On the form_current I have:

If IsNull(Me.txtImageLocation) Or Me.txtImageLocation = "" Then
    Me.imgRecordImage.Picture = ""
Else
    Me.imgRecordImage.Picture = Me.txtImageLocation
End If

But the problem is, even though the records all have different pictures indicated in the txtImageLocation, it is showing all the same pictures on each record (shows first record's picture on all).  How do I fix this?

See attached photo.
ee-duplicatephotos.jpg
0
Comment
Question by:gcgcit
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 13

Expert Comment

by:lee555J5
ID: 34933022
Why is the image control in a subform? Can you have multiple images per person record? Without seeing your db, I would have txtImageLocation and imgRecordImage on the main form, not the subform. Can you clarify?

Lee
0
 

Author Comment

by:gcgcit
ID: 34933176
The main form is "department" and then the subform shows all the people in that department.  Each person's record has a picture associated to it.  
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34933259
Can you post the database?
0
 

Author Comment

by:gcgcit
ID: 34933441
If you are assigning a value on a subform, how do you do this without affecting all records?  Should it be on an event of the control and not the form itself?
0
 
LVL 13

Expert Comment

by:lee555J5
ID: 34935658
The main form is "department" and then the subform shows all the people in that department.  Each person's record has a picture associated to it.
Where is txtImageLocation, on the main or sub form?

Lee
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 84
ID: 34937208
The only way to show different images on a continuous subform is to use a Bound Image control and store the images in your database, which is a bad idea with Access (leads to bloating and corruption).

You didn't say what version you're using, but if you're working with 2007/2010 you can use the Attachment datatype and the Attachment control. Items stored in an Attachment field are acutally stored in the database, so you may be able to do this.
0
 

Author Comment

by:gcgcit
ID: 34943023
I'm using 2003.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34943697
Then you're pretty well stuck. You _can_ load the images into the database, but as stated earlier it's not the best solution.

You COULD include the Image control on the Parent form, and then set the Picture property of that as you cycle thorugh the various subform records. To do that, you'd run code like this in your subform's Current event:

Me.Parent.YourImageControl.Picture = Me.txtImageLocation

This will show the picture for the record you're reviewing in the subform.

There's also this:

DBPix: http://www.ammara.com/

I don't know if it will work on a continuous subform, but you might give them a contact to see. I don't use it, but many Access devs do and swear by it.
0
 

Author Comment

by:gcgcit
ID: 34944531
I'm going to try upgrading to Access 2010.  LSMConsulting - can you provide a source or example of how attach datatype would work to display photos on subforms?
0
 

Author Closing Comment

by:gcgcit
ID: 34954044
I'll contact that company or upgrade, thanks for the advice.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now