Import excel to subdata table

roberttran52002

Registered User.
Local time
Today, 15:41
Joined
Aug 12, 2007
Messages
27
Hi all,

I currently have 2 link tables in Access (1/ MAIN table without subdata - all student info ie. name, age, gender... & 2/ CLASS table with subdata - link to MAIN table, these 2 tables came from 1 excel database - Part1).

Now I have another list from Excel (identical structure - Part2), I've tried so hard but failed to import this Excel file to the 2 existing tables in Access.

I would much appreciate if anyone could give me advice on how to do this.

Thank you so much in advance!

TH
 
1. First you have to import the Excel sheet to your access database.

Here is GENERAL code to transfer the excel sheet.

Create a button to your form and put this code:

DoCmd.TransferSpreadsheet transfertype:=acImport, _
tablename:="GIVE_ANY_NAME_TO_TABLE", _
FileName:=Me!GIVE_THE_LINK_FOR_YOUR_XLS, Hasfieldnames:=True, _
Range:=("GIVE_THE_EXCEL_SHEET_NAME!"), SpreadsheetType:=5

2. Then you have to create an append qry to transfer you data to your tables.
 
Thank you so much for your code and advice!

As I import the data from Excel to Access, I will have 2 more tables with the same structure as in the existing tables (1 without subdata & 1 with data). My difficulty lies at this point. I really don't know how to join these 2 sets of access tables together (especially for table with subdata). Could you please give me a hint, sorry I have very limited documents to refer to.


Thanks a million!

TH
 
You have to try yourself to create qry's or you can use the qry wizard.

It is very simple and you can do it.

To give you a hint i am sure that your tables have a ClientID or something like this to bind them.

If you can not do it then you have to import your database here to help you.
 
Thanks a lot again! It's really kind of you to give me advice and offer some help!

I will try myself to write query...I like to learn more about Access but have limited reference to this software.

I'm looking out for more read-ups.

Have a nice day!

TH
 

Users who are viewing this thread

Back
Top Bottom