In my database, lists are generally revised several times In order to update the database when a new revision is issued, all the imported data should be provided with a Revision Number and a Revision Type.
The Revision Number is the last one for the current data.
The Revision Type is a letter to characterize the import Action.
CREATION OF A NEW ELEMENT
**C**
DELETION OF AN EXISTING ELEMENT
**D**
MODIFICATION OF AN EXISTING ELEMENT
**M**
List of import file fields in excel is like below:
1- Revision Number (numeric)
2- Revision Type (text) ---"C" OR "M" OR "D"---
3- Item Number (text,PK)
4- Old Item Number (text) -- Only when Item Number has been modified—
5- Item Name (text)
6- Item Type Code (text)
Now I like to import this excel file to my table in database but I have problems:
1- How I have to design my table in access, I must have the same fields of excel file also in table
2- How I have to manage these actions , for example some row in my excel file is for creating by "C" character, some rows are for modification of item number with "M" character and also some rows are for deleting item number by "D"
Please help what is the solution, I like to browse this excel file and then pressing import button on my form and data imported according to Revision Type
Data of my excel file is like below:
RevNO Rev type itemnO olditemNO item name type
1 C A-1001 TEST1001 T1
1 C A-1002 TEST1002 T2
2 M B-001 A-001 TEST3 T3
1 D A-100 TEST4 T4
2 M A-5000 TEST6000 T6
In the access table there are already below data:
RevNO itemnO old itemNO item name type code
1 A-001 TEST1 T1
1 A-5000 TEST5000 T5
2 A-100 TEST4 T4
After import of excel file like data of access table was like below:
RevNO itemnO old itemNO item name type code
2 B-001 TEST3 T3
2 A-5000 TEST6000 T6
1 A-1001 TEST1001 T1
2 A-1002 TEST1002 T2
My questions:
1- How to import data according to revision type after pressing button on the form
2- How to browse excel file before pressing button.