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 / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Looking for files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 16 Apr 2005 02:10 GMT
I know I can use VBA to see whether a particular file exists.  However, can I
use VBA to see whether a folder contains one or more files (name or names
unknown)?  Secondly, can I use VBA to get the filename of the first file in
the folder?  If yes, could you please point me in the right direction?  
Thanks.
Andreas - 16 Apr 2005 02:19 GMT
Have a look at the DIR function.
If you call it using the path, it will return an empty string if there
is no file or the first file name.
Something like the following, but you will need to look up the help for
the specifics.

Dim strFileName as String
strFileName = Dir("C:\MyDirectory")

Regards,
Andreas

> I know I can use VBA to see whether a particular file exists.  However, can I
> use VBA to see whether a folder contains one or more files (name or names
> unknown)?  Secondly, can I use VBA to get the filename of the first file in
> the folder?  If yes, could you please point me in the right direction?  
> Thanks.
 
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.