L
LJG
Hi Guys, I do an import of a number of spreadsheets and rather than simply
append the data I want to update or add, anyone help? This is my code:
Sub Mass_Import()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSS As String
Set db = CurrentDb
Set rst = db.OpenRecordset("tblUsers") 'the name of the table
rst.MoveFirst
Do Until rst.EOF
strSS = "C:\database\dataimports\Prospects_" _
& rst.Fields("UserName") & ".xls" 'the name of the field
If Dir(strSS) <> "" Then
DoCmd.TransferSpreadsheet acImport, 8, "tblmamprospects", _
strSS, True, ""
End If
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
TIA
Les
append the data I want to update or add, anyone help? This is my code:
Sub Mass_Import()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSS As String
Set db = CurrentDb
Set rst = db.OpenRecordset("tblUsers") 'the name of the table
rst.MoveFirst
Do Until rst.EOF
strSS = "C:\database\dataimports\Prospects_" _
& rst.Fields("UserName") & ".xls" 'the name of the field
If Dir(strSS) <> "" Then
DoCmd.TransferSpreadsheet acImport, 8, "tblmamprospects", _
strSS, True, ""
End If
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
TIA
Les