Macros do not have error handling.
I recommend you use VBA code instead.
Once you get used to code you won't need to use macros.
In code you can check to see that the file exists and then do something else
if it does not.
Joe,
What is/are the command(s) to test to see if a file exists?
Thanks,
Jim
> Macros do not have error handling.
> I recommend you use VBA code instead.
[quoted text clipped - 19 lines]
> >
> > Pele
Joe Fallon - 01 Jun 2005 00:38 GMT
Here is one way:
Add this code to a module:
Public Function FileExists(strPath As String, Optional lngType As Long) As
Boolean
On Error Resume Next
FileExists = Len(Dir(strPath, lngType)) > 0
End Function
Then anywhere in your code you can call it like this:
If FileExists("C:\mydocs\MyFile.txt") Then
'do something with the file
End If

Signature
Joe Fallon
Access MVP
> Joe,
>
[quoted text clipped - 28 lines]
>> >
>> > Pele