I am trying to append an Excel file to a table. The append actually works, however, I get an error message. It says: "Microsoft Access was unable to append all the data to the table." Then it says "The contents of fields in 0 records were deleted, and 0 records were lost due to key violations."
The data appears to have imported fine, but I am not sure what the message is trying to tell me. Where should I look? I've looked at required fields, indexed fields, etc and everything seems ok. I've tried to make sure the formatting in Excel was good too. Here's the import snippet just in case.
The data appears to have imported fine, but I am not sure what the message is trying to tell me. Where should I look? I've looked at required fields, indexed fields, etc and everything seems ok. I've tried to make sure the formatting in Excel was good too. Here's the import snippet just in case.
Code:
Dim fdg As FileDialog
Dim vrtSelectedItem As Variant
Dim strSelectedFile As String
Set fdg = Application.FileDialog(msoFileDialogFilePicker)
With fdg
.AllowMultiSelect = False
.InitialView = msoFileDialogViewDetails
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
strSelectedFile = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="tbl_ItemStatusInfo", filename:="" & strSelectedFile & "", HasFieldNames:=True