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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying A Directory

Status
Not open for further replies.

chrrox

Technical User
Joined
May 24, 2006
Messages
1
Location
US
I want to have a command that will output the contends of a we birectory to a table. I thought I might be able to do this with a dir loop command. Specificly I want to query pictures in a directory but everything in this directory would be fine as that is all that is in there.

One last not.
What I am tring to do is have it so when I delete an entry in a database it will automaticaly delete a picture if it is no longer in the database.

Thanks so much in advance I have been pulling my hair out on this one.
 
Sub BackUpFiles()
On Error GoTo xxx

Dim strFile As String, strText As String
Dim varDest As Variant, x As Integer, strPath As String

varDest = "C:\Documents and Settings\WorkBackUp\"


strFile = Dir(varDest)

Do Until strFile = ""
strText = strText & strFile & vbCrLf
strFile = Dir()
Loop


Debug.Print strText

xx:
Exit Sub
xxx:
Resume xx
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top