Private Sub Command3_Click() Dim strFile As String 'Filename Dim strFileList() As String 'File Array Dim intFile As Integer 'File Number Dim filename As String Dim path As String DoCmd.SetWarnings False path = "G:\Store Planning\Projects\Parts Tracker\ToImport\" 'Loop through the folder & build file list strFile = Dir(path & "*.xls") While strFile <> "" 'add files to the list intFile = intFile + 1 ReDim Preserve strFileList(1 To intFile) strFileList(intFile) = strFile strFile = Dir() Wend 'see if any files were found If intFile = 0 Then MsgBox "No files found" End If 'cycle through the list of files For intFile = 1 To UBound(strFileList) filename = path & strFileList(intFile) DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tmpShipping", filename, True 'Erroring on this line Next intFile DoCmd.SetWarnings True End Sub
|How can I name a sub macro so Shift/F10 would work.||3||22|
|selection of current record jumps to a non-selected record||8||37|
|Steps to program a particular database app using access and any programming language.||16||37|
|append to an ms access field||6||25|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!