[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Duplicate Photos on Subform.

Posted on 2011-02-19
10
Medium Priority
?
927 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
[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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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
 
LVL 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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 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 …

649 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