File of a photo exist

J

jean

Hi

I have a form (based on a query)that generate a photo for each record

OnCurrent of the form I have the following code

Me![ImageFrame].Picture = [ImagePath]

ImagePath: DLookUp("PhotosPath","TInfos") & [EmpPhoto]

PhotosPath reside in an othe table in case of moving photos to another
directory

EmpPhoto is a field of the table Employees

so for each record there is something like 2134.jpg or 4522.jpg

let say in the Info table I have c:\Employees Photos in the field
PhotosPath

So ImagePath becomes c:\Employees Photos\2134.jpg and it is ok

Lets say somebody change 2134.jpg in the field [EmpPhoto] for 5555.jpg
and that that file does not exist , in the future, when I will reach
that record, I will have an error message.
What I want is to put some code (after update event) that will check
right away if that file exist and if not, I will replace the 5555.jpg
with an existing one and pop up a message telling that the file don'y
exist

I have seen some function (because question was asked before) but was
not able to manage it

I have also seen something like

if len (......) = "" then...
without success

Maybe I just nedd some refresh somewhere in the code, but I dont know.

Can someone help me ? I need something detailed

thanks
 
D

Douglas J. Steele

If Len(Dir(ImagePath)) = 0 Then
MsgBox ImagePath & " does not exist."
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