ViolettePhan
06-26-2006, 10:43 AM
Hi all,
I'm new here and also newbie to VBA. Please help me out...
I have 4 tables:
tbl_Address (AddressID(autonumber), Company, title, address, city...)
tbl_X_Ref_Address (AddressID, CategoryID, SubCategoryName)
tbl_Category (CategoryID, CategoryName)
tbl_Ref_SubCategory(CategoryName)
My requirement is to create a form to import external address (mostly in excel format) into the tbl_Address, it should read the columns in the import file and allow user to match them with the corresponding column in tbl_Address.
So I created a form: an option for user to open file dialog to pick their excel file location, a list box of Categories lstCategory, and combo box for SubCategories cmbSubCategory. & a command button cmdImport. So far I can code up to just import (append) the data into tbl_Address, but I need to insert those new record from tbl_Address to cross reference table tbl_X_Ref_Address with those new AddressID, CategoryID and SubCategory.
Can anyone please show me how to do it... I'm hitting the wall right now... I haven't figure out how to give user the option of pick columns yet but I can save it for later work. Right now I just want to see how to import to cross reference table first...
Many thanks
Violette
I'm new here and also newbie to VBA. Please help me out...
I have 4 tables:
tbl_Address (AddressID(autonumber), Company, title, address, city...)
tbl_X_Ref_Address (AddressID, CategoryID, SubCategoryName)
tbl_Category (CategoryID, CategoryName)
tbl_Ref_SubCategory(CategoryName)
My requirement is to create a form to import external address (mostly in excel format) into the tbl_Address, it should read the columns in the import file and allow user to match them with the corresponding column in tbl_Address.
So I created a form: an option for user to open file dialog to pick their excel file location, a list box of Categories lstCategory, and combo box for SubCategories cmbSubCategory. & a command button cmdImport. So far I can code up to just import (append) the data into tbl_Address, but I need to insert those new record from tbl_Address to cross reference table tbl_X_Ref_Address with those new AddressID, CategoryID and SubCategory.
Can anyone please show me how to do it... I'm hitting the wall right now... I haven't figure out how to give user the option of pick columns yet but I can save it for later work. Right now I just want to see how to import to cross reference table first...
Many thanks
Violette