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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking a csv file to see if already imported

Status
Not open for further replies.

BHScripter

Technical User
Aug 26, 2002
159
US
Hi:

I have an access database and monthly we import invoices via csv files. The problem is that the file sometimes gets imported more than once.

the procedure is such that the csv file is imported into a holding table where it is given a provider ID number and then that info is updated into the main table.

Is there a way to look at the invoice # and date of the csv file even prior to pulling it into the holding table?

This is the script as it exists now:

Private Sub AT_T_Import_Button_Click()
DoCmd.SetWarnings False

Dim strMessage As String
Dim intOptions As Integer
Dim bytChoice As Byte

strMessage = "You are about to import an Invoice - You'd better be sure!"
intOptions = vbQuestion + vbOKCancel
bytChoice = msgbox(strMessage, intOptions)

If bytChoice = vbCancel Then
Cancel = True
Else
' Import ATT.csv using AT&T Spec
DoCmd.TransferText acImportDelim, "AT&T Import Specification", "TblNewTrans", "m:\management\import files\att.csv", False, ""
' Update Provider ID in TblNewTrans
DoCmd.OpenQuery "qupdProvID inTblNewTrans", acViewNormal, acEdit
' Runs Unmatched query to validate there are matched records in IT Provider Master Table
DoCmd.OpenQuery "qValidateImportedInvoice", acViewNormal, acEdit
End If

Thanks in advance,
Brianna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top