Simple Userform With Picture

Excel Simple Userform With Picture

         Simple userform with next and previous record displaying command buttons including picture displays.
Important point is that ,names of the pictures with names of people in column A are same.
The picture with the same name as the value entered in the name texbox control (txtFirstName) is searched in the folder.

Codes to check the presence of the image in the folder:
With Cells(currentrow, 1)
txtFirstName.Text = Cells(currentrow, 1).Value
Set NameFound = .Find(txtFirstName.Text)

With NameFound
On Error Resume Next
imgData.Picture = LoadPicture(fPath & "nopic.jpg")
imgData.Picture = LoadPicture(fPath & txtFirstName.Text & ".jpg")
End With
End With

If recording don't have a picture ,"No Picture" (nopic.jpg) is displayed.

No comments:

Post a Comment