Sorry, Frank, you are out of luck. There is no way to import multiple tables "all at once".
However, what you need to do is relatively easy, once you do a thorough review of your database structure. I would create a single proceedure (sub or function), in put multiple lines of the docmd.Transferspreadsheet.
1. Identify all of your lookup tables (those tables which have a primary key, but don't contain any foreign keys). Import these tables first.
2. Then identify those tables that only have foreign keys that relate to the tables imported during step #1, and import them.
3. Lastly, identify the other tables, and import them in sequence, making sure that all of the tables with PKs that are referenced as FKs have already been imported.
This last step is generally the most difficult, but unless you have tables with 5 or 6 FK fields, it should not be too bad. If you step through your code, and go into debug mode when you encounter an error message, then you can shuffle the lines of code until it works properly.
-- HTH Dale
email address is invalid Please reply to newsgroup only.
"Frank Situmorang" wrote:
[Quoted Text] > Hello, > > If I want to import data from excel/access for consolidation of data, how > can we import all tables at once. I need it because of the following: > > In members table there is a forein key for address table primary key. FK in > member is a required field and we need to import all data at once, otherwise > it will be rejected. > > Anyone can help me how can we do it?. > > Thanks in advance for any help provided. > > -- > H. Frank Situmorang
|