By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

List Directory- Include Hiden files - Access !?

P: 6
Hi,
I am using this code in access form to list everything in directory but it did`not show hidden or system files.
how works this code to list all files include hidden or system files.?
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim LoadFiles   As String
  3. Dim strFill     As String
  4.  
  5. LoadFiles = dir$("c:\*.*")
  6. Do While LoadFiles > ""
  7. strFill = strFill & LoadFiles & ";" 
  8. LoadFiles = dir$
  9. Loop
  10. lstFiles.RowSource = strFill
  11.  
  12. End Sub
Thank you
Nov 17 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,599
Try:
Expand|Select|Wrap|Line Numbers
  1. Dim LoadFiles As String
  2. Dim strFill As String
  3.  
  4. LoadFiles = Dir$("c:\*.*", vbbHidden Or vbSystem)
  5.  
  6. Do While LoadFiles <> ""
  7.   strFill = strFill & LoadFiles & ";"
  8.   LoadFiles = Dir$
  9. Loop
  10.  
  11. lstFiles.RowSource = strFill
Nov 19 '08 #2

P: 6
Try:
Expand|Select|Wrap|Line Numbers
  1. Dim LoadFiles As String
  2. Dim strFill As String
  3.  
  4. LoadFiles = Dir$("c:\*.*", vbHidden Or vbSystem)
  5.  
  6. Do While LoadFiles <> ""
  7.   strFill = strFill & LoadFiles & ";"
  8.   LoadFiles = Dir$
  9. Loop
  10.  
  11. lstFiles.RowSource = strFill

It Works Many thanks ......
Nov 20 '08 #3

ADezii
Expert 5K+
P: 8,599
It Works Many thanks ......
Glad it works for you.
Nov 20 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.