Results 1 to 2 of 2
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Populate Combo Box with list of files

    I have a folder that contains .csv files that are exported using another system. I want my users to click the combo box and have the list of files within that directory be items to select. What's the best method? Any literature on this? Thanks!

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Code:
        Dim FSO As Object, fld As Object, Fil As Object
        Dim SubFolderName As String
        Dim i As Integer
        
        Set FSO = CreateObject("Scripting.FileSystemObject")
        
        SubFolderName = "\\Fdlxrdw1\mstr_dmapp_prd\"
        Set fld = FSO.GetFolder(SubFolderName)
        For Each Fil In fld.Files
            i = i + 1
            If Right(Fil, 4) = ".csv" Then
                Me.cboSelFile.AddItem Fil.Name
            End If
        Next Fil

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

Similar Threads

  1. Replies: 4
    Last Post: 01-24-2011, 07:11 PM
  2. Use Combo Box to Populate Form
    By gracysaurus in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 02:40 PM
  3. How To View List of Files in Box
    By treyprice in forum Forms
    Replies: 3
    Last Post: 01-14-2010, 03:40 PM
  4. Populate Combo Box
    By wes28 in forum Programming
    Replies: 1
    Last Post: 03-04-2009, 06:45 AM
  5. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM

Tags for this Thread

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