Hi everyone,
Hope you are good. Hope you can help me out on this. I've been trying to make a database and to import info from an excel spreadsheet to an access table. I have used a code I found on the web and the same does not returns errors, however, when I go to the table in acess that should contain the info only contains rows created in blank. On the spreadsheet I have only 200 rows, and on the access more than 6,000 rows are created. Do you have any idea why?
This my code:
Thanks in advance!
Hope you are good. Hope you can help me out on this. I've been trying to make a database and to import info from an excel spreadsheet to an access table. I have used a code I found on the web and the same does not returns errors, however, when I go to the table in acess that should contain the info only contains rows created in blank. On the spreadsheet I have only 200 rows, and on the access more than 6,000 rows are created. Do you have any idea why?
This my code:
Code:
Private Sub cmdImport_Click()
'Unset warnings
DoCmd.SetWarnings False
'SQL delete statement
DoCmd.RunSQL "DELETE * FROM tblPymElectionCurrent"
'Import spreadsheet
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblPymElectionCurrent", selectFile(), True, Range:="Payment List$"
DoCmd.SetWarnings True
End Sub
Thanks in advance!