Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder Contents

Status
Not open for further replies.

dhaveedh

Programmer
Aug 13, 2003
112
GB
Does anyone know how i can get the list of files in a folder in Access?

I want to list all the files in a folder and find out if a particular file exists.

Help appreciated.



KISS - Keep It Simple Sugar!
 
you could do something like this:

Dim SnapFile As String

SnapFile = "C:\" & "Quote " & quoteno & " Revision " & revno & ".snp"

' check if file exists
If Dir(SnapFile) <> "" Then
MsgBox "File exist."
Else
MsgBox "File does not exist."
End If
 
Google "FileScriptingObject". There is so much code out there on it you can probably cut and paste what you need
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top