Check for file in folder

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi

Am using Access 2003 and Windows XP Pro.

On entering a form I would like the code to check if a specific image file
[checkid.jpg] is in a specific folder [D:\Data\Images] on this pc.

Any code examples on how to achieve this would be appreciated.

TIA

Tom
 
Hi

Am using Access 2003 and Windows XP Pro.

On entering a form I would like the code to check if a specific
image file [checkid.jpg] is in a specific folder [D:\Data\Images]
on this pc.

Any code examples on how to achieve this would be appreciated.

TIA

Tom
example: hard coded path and file name from testbox on form
FileExists = dir("D:\Data\Images" & "\" & me.filename)
 
you could use the Dir function, as

If Dir("D:\Data\Images\checkid.jpg") = "" Then Msgbox "File not found."

read up on the Dir function in VBA Help, so you'll understand how it works.

hth
 
Back
Top