George Too
Registered User.
- Local time
- Today, 14:18
- Joined
- Aug 12, 2002
- Messages
- 198
I have this code to import an Excell spreadsheet:
'--- Declare variables
Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook
Dim objSht As Excel.Worksheet
Dim rst As Recordset
Dim Msg, BoxTitle, DlgStyle As String
'--- open the workbook
Set objXL = New Excel.Application
objXL.Visible = False
'--- Instructions passed to Excel
Workbooks.Open Filename:=Me!txtPath
'--- turn warnings off
DoCmd.SetWarnings False
'--- Import a spread sheet
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblMain", [Forms]![frmImportData]![txtPath], True
Now:
Where do I insert filtering code so that records dont duplicate in tblMain (the destination table)?
And, what would this code look like?
I posted a similar topic some time ago but that did not work for me as this is an automatic-one-button-pushing-deal.
Thanks for your responses.
'--- Declare variables
Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook
Dim objSht As Excel.Worksheet
Dim rst As Recordset
Dim Msg, BoxTitle, DlgStyle As String
'--- open the workbook
Set objXL = New Excel.Application
objXL.Visible = False
'--- Instructions passed to Excel
Workbooks.Open Filename:=Me!txtPath
'--- turn warnings off
DoCmd.SetWarnings False
'--- Import a spread sheet
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblMain", [Forms]![frmImportData]![txtPath], True
Now:
Where do I insert filtering code so that records dont duplicate in tblMain (the destination table)?
And, what would this code look like?
I posted a similar topic some time ago but that did not work for me as this is an automatic-one-button-pushing-deal.
Thanks for your responses.