Hi All,
I want to be able to read a csv file using VBA inside the Access mdb that is attached and insert new data into the Company table from the csv file. The VBA should also be smart enough to check if the data already exists in the Company table by matching Company column inside the csv file with the CompanyName column in the Company table in the mdb file. If there is no match than insert the data into the Company table: The following data mapping of columns from the csv file to the Company table are as follows and shoud be used:
CSV File: MDB File:
Company = CompanyName
Address_Line_1 = Street1
Address_Line_2 = Street2
City = Suburb
Zip_Code = PC
Phone = Telephone1
Phone_-_Mobile = Telephone2
Email = email
Web_Page = www
The above fields are the ONLY fields that need to be inserted into the Company table from the csv file if the company does not exist in the Company table.
The 2nd part is reading the CSV file and inserting new data into the Contact table from the csv file. There needs to be a check by the csv file fields: First_Name and Last_Name columns with the Contact table columns: FirstName and Surname so that the same data in the csv file does not get inserted when there is a match.
The mapping of the data that needs to be entered is:
CSV File: MDB File Contact table:
First_Name = FirstName
Last_Name = Surname
Title = Title
Phone = TelephoneExt
Phone_-_Mobile = mobile
See attached mdb file and csv file.
PLEASE HELP ME,
Kindest Regards
darrylf290567
Start Free Trial