Hi There!
Currently I am importing a .csv file that eventually grows over
time. I have setup my table with an unique id field that is the
primary key and indexed. I have also indicated in the import
specifiaction that this field is indexed and that no duplicates
should be accepted.
My problem right now is that each time I import this file into
my database, it will overwrite what already exists and I would
have to go back and redo all my corrections.
Here is the script that runs when we click to download the
information:
Private Sub DownloadWaiver_Click()
On Error GoTo Err_DownloadWaiver_Click
Dim strFileName As String
Dim strPathExample As String
Dim strImportSpec As String
Dim strTableName As String
Dim strQueryName1 As String
Dim strQueryName2 As String
strPathExample = "Save File as i:\arfeedtobedone\waiver_data.csv"
strImportSpec = "Waiver Import Specification"
strTableName = "tblWaiver"
strFileName = "i:\arfeedtobedone\waiver_data.csv"
strQueryName1 = "01_updateqryWaiverSSN"
strQueryName2 = "02_updateqrytblWaiverSystemPIDM"
' Set warnings to off
DoCmd.SetWarnings False
' Import Health Waiver file
DoCmd.TransferText acImportDelim, strImportSpec, strTableName, strFileName,
False, ""
' Change the Health Waiver file info into a format to feed Banner
DoCmd.OpenQuery strQueryName1, acNormal, acEdit
DoCmd.OpenQuery strQueryName2, acNormal, acEdit
' Reset warnings to on
DoCmd.SetWarnings True
MsgBox "Health waivers have been added to tblWaiver."
Exit_DownloadWaiver_Click:
Exit Sub
Err_DownloadWaiver_Click:
MsgBox Error$
Resume Exit_DownloadWaiver_Click
End Sub
Is there anyway to modify this so that Access will not import
the entries that already exist?
Thanks for your help!
--
Regards,
George Yeh