Question : TransferSpreadsheet VBA Import from Excel to Access

Can anyone help me with a VBA code that will transfer a spreadsheet into a table in access but between the transfer, I wanted to have some kind of a process that will do insert into the tables based on conditions and will automatically generate an id in Access table and insert either "Regular" or "Temp" based on the Last Name wildcard condition.

Thank you in advance.

Example fields on excel file number 1(transfer #1)

LastName FirstName Address      BirthofDate
Smith       John         LA             July 6, 1982
Johnson    Mike         CA             June 1, 2004

fields on excel file number 2(transfer #2)
LastName FirstName Address      BirthofDate
Johnper       Mike         KY             July 6, 1982
Kilroy        Mel         NE             June 1, 2004


AFTER Transfer 1 and 2, the
 Desired fields on Access should be below

ID    LName    FName    Address    BirthofDate           Remark(note that if there is "John" in the last name in excel file)
1       Smith     John         LA           July 6, 1981          Temp
2     Johnson    Mike        CA           june 1, 2004         Regular
3       Johnper     Mike         KY             July 6, 1982     Regular
4        Kilroy        Mel         NE             June 1, 2004    Temp
 

Answer : TransferSpreadsheet VBA Import from Excel to Access

You can run the update code right after you import the record.

Here are couple questions.

1. If you don't want to use auto number for you PK, what do you want to use then?

>>>note that if there is "John" in the last name in excel file
2. I still don't see it, but what is the criteria for the field  'Remark' to become "Temp" or "Reguler"?

blee17517
Random Solutions  
 
programming4us programming4us