automatically refresh picture?

M

martinmike2

Hello,

I have a personnel form that shows employee pictures. I would like
this form to automatically show the employees picture. I have it
showing the picture automaticaly, but when i navigate to a record that
dosn't have a picture, the las tpicture shown is displayed. The
pictures are stored in a seperate file, outside the database.

Dim loc As String
Dim pic As Integer
Dim strPic As String
loc = "S:\JAXS\AIMD\SHARES\Manpower db\Pictures\"
pic = gSSN
Me.imgEmp.PICTURE = loc & pic & ".jpg"

-Michael Martin
 
K

Klatuu

Create a graphic jpg that says something like "No Picture Available".

Then test to see if the employee's picture ins on file. If is is, display
it. If it is not, display the default:

If Dir(loc & pic & ".jpg") = vbNullString Then
Me.imgEmp.PICTURE = loc & "NoPic.jpg"
Else
Me.imgEmp.PICTURE = loc & pic & ".jpg"
End If
 

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