Hi ...I have been looking for a way to automate a data import from an Excel spreadsheet, which is updated daily and needed to be imported to the DB, the previous days data needed to be deleted with the current days data only, being stored in the table, I wanted to do this by clicking on a command button on a switchboard, bit of a novice but found a couple of posts, which have done in a simple way just what I needed, hopefully it will be of use to someone else
The qry is an Access delete query.
Private Sub XLImport_Click()
DoCmd.OpenQuery "qry_DeleteAgedDebtors"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblYourtblName", "Path:\YourPathName\ExcelSpreadsheetName.xls", True
EndSub
cheers
Fi
The qry is an Access delete query.
Private Sub XLImport_Click()
DoCmd.OpenQuery "qry_DeleteAgedDebtors"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblYourtblName", "Path:\YourPathName\ExcelSpreadsheetName.xls", True
EndSub
cheers
Fi