Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Find Folders

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sparker - 27 Dec 2005 17:04 GMT
Anybody have a quick solution to locate a folder (not a file) with only part
of the folder name? Actual folder name could be "2206516_BlahBlahBLah"
however the "BlahBlahBlah" portion is an unknown...
__________________________________________________________________
Dim MyPath as string
Dim MyPieceOfFolderName as string
Dim MyTargetFolderName as string                'Should be something like *

MyPath = "C:\WorkingFolder\"

MyPieceOfFolderName = "2206516"

MyTargetFolderName  = DIR(MyPath & MyPieceOfFolderName & "*")

Do While MyTargetFolderName  <> ""
  Debug.Print MyTargetFolderName
Loop
__________________________________________________________________
Thank you in advance for any information you can provide locating these
folders with only partial folder names...~ SPARKER ~
Douglas J. Steele - 27 Dec 2005 19:20 GMT
Try

MyTargetFolderName  = DIR(MyPath & MyPieceOfFolderName & "*", vbDirectory)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Anybody have a quick solution to locate a folder (not a file) with only
> part
[quoted text clipped - 18 lines]
> Thank you in advance for any information you can provide locating these
> folders with only partial folder names...~ SPARKER ~
sparker - 28 Dec 2005 13:52 GMT
Thanks Douglas that did the trick!
Merry Christmas and Happy New Year! ~ SPARKER ~

> Try
>
[quoted text clipped - 22 lines]
> > Thank you in advance for any information you can provide locating these
> > folders with only partial folder names...~ SPARKER ~
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.