Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004

    Question Unanswered: Look at a table row by row and import data from a file based on a path in that row

    [I posted this in the ACCESS section but have now realised it may have been in the wrong place, sorry]

    Hi everyone, its my first time writing, but I have used this site before and its proved so helpful - thank you.

    I've seen this done before, but for the life of me cannot figure out how to write it.

    I have a table, in ACCESS, tbl_filelist that contains the paths and file name for excel files in 2 columns: 'path' and 'filename'. Through Visual Basic I want to import a range, 'sick_data', from each file. The import part is simple enough; it’s just the part of getting the code to look at each row in a table in sequence that baffles me.

    Please help.
    Last edited by MASARU; 11-09-04 at 08:44. Reason: further detail

  2. #2
    Join Date
    Nov 2004
    just incase any are interested, from several sources i managed to peice this together:

    Private Sub updatesource_Click()
    Dim rst As DAO.Recordset
    Dim strTable As String
    Dim strMessage As String
    strTable = "SELECT SubFolder & " / " & FileName AS [FullPath] FROM tbl_FileList;"
    Debug.Print strTable
    Set rst = CurrentDb.OpenRecordset(strTable, dbOpenDynaset)
    With rst
    If Not .EOF And Not .BOF Then
    Do While Not .EOF
    strMessage = "open " & .Fields("FullPath")
    MsgBox strMessage
    End If
    End With
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts