Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem on DoCmd.TransferSpreadsheet

Status
Not open for further replies.

kkgusta

MIS
Nov 10, 2005
42
NZ
We would like to know if there is a way of identifying duplication of records in an Access Table
Below is the code that we have use to import record into an Access Table

Private Sub Command28_Enter()
On Error GoTo Command28_Enter_Err

Dim strpath As String
strpath = Text29

DoCmd.TransferSpreadsheet acImport, 8, "Script", strpath, True, ""
DoCmd.ShowAllRecords

Command28_Enter_Exit:
Exit Sub

Command28_Enter_Err:
MsgBox Error$
Resume Command28_Enter_Exit

End Sub

However if there is any duplication of record, the TransferSpreadsheet command will only identify how many record were lost due to this violation. What we want is, If we can somehow identify which specific records were lost ?
 

1] Use an extra table [tableA] to import the data form excel
2] Append new records to your existing importing table [tableB]
3a] Delete from tableA the remaining not appended.
3b] Create a not matching query using tableA and tableB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top