Dim db As Database
Dim filepath As String
Dim fs
Dim strFullPath As String
Set db = CurrentDb
strFullPath = db.Name
filepath = Left$(strFullPath, InStrRev(strFullPath, "\"))
if fs.filexists(filepath & "file name") then
your code here.
endif
Dim db As Database
Dim filepath As String
Dim fs
Dim strFullPath As String
Set db = CurrentDb
strFullPath = db.Name
filepath = Left$(strFullPath, InStrRev(strFullPath, "\"))
if fs.filexists(filepath & "file name") then
your code here.
endif
That won't work as written. You'd need at least to create a
FileSystemObject and set the fs variable to point to it. But for most
purposes, I think FSO is overkill when all you want to do is find out if a
file exists.
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.