Photo issue

E

Eric F

I had some great help in this newsgroup on displaying photos for contacts in
a specific table. What I am having trouble with is that I am losing the
connection to the network path where I have the contact photos. If I select
the image box and relink the picture path it works fine. But I lose the
connection after I close out the project. Here is the code for displaying
the pics. Any help would be greatly appreciated.

Private Sub Form_Current()
On Error GoTo Err_NoPic
Dim PathToPhoto As String
Dim ContactPhoto As String
PathToPhoto = "I:\NAIOP_Website\images\Members"
ContactPhoto = Me.ContactID & ".jpg"

If Len(PathToPhoto & "\" & Me.ContactID & ".jpg") <> 0 Then
ContactPic.Picture = ContactPhoto
Else
ContactPic.Picture = ""
End If

Err_NoPic:
Select Case Err
Case 2220
ContactPic.Picture = ""
End Select

End Sub
 
A

Arvin Meyer [MVP]

The line:

ContactPhoto = Me.ContactID & ".jpg"

should read:

ContactPhoto = PathToPhoto & "\" & Me.ContactID & ".jpg"

or change the PathToPhoto variable slightly to be = to:

PathToPhoto = "I:\NAIOP_Website\images\Members\"

Then you could use:

ContactPhoto = PathToPhoto & Me.ContactID & ".jpg"

--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top