Viewing "Linked" images usin a combo box

unclefink

Registered User.
Local time
Yesterday, 20:31
Joined
May 7, 2012
Messages
184
I have a form containing employee information and a spot to show a specific employees image which i am linking via "link" (picture not directly attached to DB).

In the form I have a combo box containing a list of employee names and when i choose a specific person, that employees data and image shows on the form.

This leads me to my dilema.

Any time i choose the person who is listed first in the database, the "text" information pops up but not their image therefore leaving me seeing the correct information with the image of the employee i was looking at prior to choosingg the new person. It appears as though this anomoly is only happening when the first person listed in the db is chosen. The only way I can see a complete profile of this person is if i close the form out and reopen it; which causes the employee information and image to default to the person who is having the issue.

My goal is to be able to see anyone's picture regardless of where they are listed in the main db table without having to close and open it again.

Any suggestions?

Thanks in advance.
 
Perhaps the attached sample is doing the sort of thing you are after.

Be sure to copy the folder of images and the DB to the same location.
 

Attachments

Thank you John for attempting to help me out with this. I've opened the sample and find this code in the "on load" portion of the form.

Option Compare Database
Private Sub Combo11_Change()
Me.List13.Requery
Me.List13.SetFocus
Me.List13.Selected(1) = True

Me.Image5.Picture = Me.List13.Column(4)

End Sub

Private Sub Form_Current()
End Sub
Private Sub Form_Load()


Me.Image5.Picture = ""
Me.Combo11.SetFocus
Me.List13.SetFocus
Me.List13.Selected(1) = True

Me.Image5.Picture = Me.List13.Column(4)
End Sub
Private Sub List13_Click()

Me.Image5.Picture = Me.List13.Column(4)

End Sub


It appears to be similar to what I am using, however on a much higher scale. I'm using. This is what i've got in my on load and on current.

Option Compare Database
Private Sub Form_Current()
Image10.Picture = SubjectImage
End Sub


Is it the "Me" that makes it change regardless of what you choose in the dropbox?

Also in your sample, there is a combo and list box. I am only using the "combo box". Now thinking about it, i'm assuming some of that code is for the "list box"?
 
In the sample, the combo box is filtering the results displayed in the list box.

If you put the form in design view and have a look at the Row Source of the list box, you will see how the path for each flag is constructed.

The On Click event of the List box contains the code that populates the Image holder.

The code in the On Load event of the form is merely to populate the list box according to the default value of the Combo box.
 
I think I am very confused as to what if anything I need to do. Your sample is very similar to what i've already got except is not cycling through that one image.

In my form, I have a combo box that is filtering the data and showing the profile of a specific person which has a text field with a file path.

In the form properties, i have the "imagebox" pointing at the text box containing the file path. The code currently reads employeeimage.picture=EmployeePicture.

All of the pictures are showing as i'd like with an exception of one individual. In continuing my investigation into this matter, I discovered that the form will open with the first person who's name comes first; however when i choose a different name, the new individual's profile and picture pops up but when i go back to the first person it only changes the profile information and not the picture. The picture of the second person remains rather than switching back to the first person. Not sure if this matters or not, but this form is derived from a query with the necessary data information.

Thank you again for you help and patience as i'm learning on the fly and i'm not all too familiar with coding.

Respectfully,
 
I suspect that you need to put the code that is loading the image, in the Form's On Current event so that the image is changed as your user scrolls through the records.
 

Users who are viewing this thread

Back
Top Bottom