VBA Access Mdule equvalant of if exist c:/path/file

G

Guest

I am looking for the access vba Function syntax that is equivalent to the
script command

if exist c:\path\file goto result
echo it does not exist
exit
:result
echo it does exist
exit

any answers welcome.

Thanks,
JimBrim
 
M

Marshall Barton

JimBrim said:
I am looking for the access vba Function syntax that is equivalent to the
script command

if exist c:\path\file goto result
echo it does not exist
exit
:result
echo it does exist
exit


That's Fairly close. Try this:

If Dir("c:\path\file") <> "" Then
Echo "it does not exist"
Else
Echo "it does exist"
End If

Not sure how you want to display the result, Echo displays
it in the status bar, assuming you have it enabled.
 

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