Results 1 to 5 of 5
  1. #1
    shod90 is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Jan 2016
    Posts
    134

    Question Listing files and folders contents in access forms

    Dear Gents,


    Anyone have code for listing files and folders inside the main folder i need to show in the access form .
    Actually i need to make a form like windows explorer exactly that when i double click on a folder it takes me to the sub folder , and when i click on the file it opens as if i open it from the normal windows explorer .
    I got a code that list the (Files) in list box only but not opening it , also i shows the path of the files in the list box. see below..

    Click image for larger version. 

Name:	Captureas.JPG 
Views:	24 
Size:	44.1 KB 
ID:	27356

    I need to hide the folder path because i don't want to let users knows where the files are located.
    Any ideas ? ..

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Maybe try the File Dialog Box. What type of files will they be opening?

    https://msdn.microsoft.com/en-us/lib...ffice.12).aspx

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  4. #4
    shod90 is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Jan 2016
    Posts
    134
    Quote Originally Posted by orange View Post
    This Allen Browne link may be helpful.
    Actually this is only for ( viewing ) folder ( files ) not folders as well , also i need when i double click on one item in the listbox i need to open it .
    Quote Originally Posted by Bulzie View Post
    Maybe try the File Dialog Box. What type of files will they be opening?
    https://msdn.microsoft.com/en-us/lib...ffice.12).aspx
    I don't want the Dialog box otherwise users will know where is the path of that important files , i. Need to make something like hyperlink for all folder and files inside the main folder

  5. #5
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 8 Access 2013
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    I use this code to open files with there associated app: http://www.mvps.org/access/api/api0018.htm

    You could use the code above in the click event of the list box.

    If you want to hide the full path then what I do is add a second column to the list box that is hidden (width = 0") In the first column that is visible only show the file name. When the user clicks the item, use the data in the second column witht he code above.

    Here is code to get the file name from the full path:

    Code:
    Function FunctionGetFileName(FullPath As String)
    Dim StrFind As String
    Dim iCount as long
    
    	Do Until Left(StrFind, 1) = "\"
    		iCount = iCount + 1
    		StrFind = Right(FullPath, iCount)
    		If iCount = Len(FullPath) Then Exit Do
    	Loop
    	
    	FunctionGetFileName = Right(StrFind, Len(StrFind) - 1)
    	
    End Function


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-24-2016, 04:54 PM
  2. Importing a bulk of files from different folders
    By jangobango in forum Access
    Replies: 10
    Last Post: 03-07-2016, 04:30 PM
  3. Can not see the Contents of these two files .
    By eslam_elbyaly in forum Access
    Replies: 1
    Last Post: 10-31-2014, 07:00 AM
  4. Access collection of files and folders?
    By pctechtv in forum Access
    Replies: 1
    Last Post: 11-13-2011, 05:50 PM
  5. One to Many Listing in Forms
    By zunebuggy in forum Forms
    Replies: 5
    Last Post: 05-11-2010, 08:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums