Link to home
Start Free TrialLog in
Avatar of Ianski
Ianski

asked on

Access 2010: Merge Database with the same structure

So I had to provide my staff with a copy of Access form/database (cant use serever) and merge their input from time to time. As my form contains several multiple fields I cant do that through 'ammend query'. All my tables are connected to the main one through the same key (star )
I googled a solution below however it doesnt include databases with relationships:
http://ilovecoding.co.uk/blog/ms-access/merge-multiple-ms-access-databases-into-a-single-one/

For now Im just copy pasting but that obviously takes too much time...

Can somebody provide me an example of a similar VBA solution?
Avatar of als315
als315
Flag of Russian Federation image

You can assign to every user's base some unique number, which will be added to main DB.
For example: First user will have ID =1, Second - 2 etc.
Main table should have index form this ID (user) and record ID.
Example have 2 tables and 2 append queries. You can also update records, if you like it with update queries
DB27373708.accdb
Avatar of Ianski
Ianski

ASKER

Yup thats correct however as I wrote cant use append (or ammend :P ) queries cause I have multipple input fields. Besides Id like to join 2 separate databases not tables if possible.
Looking for VBA automation
May be you can show example of your Dbs? What is joining of databeses? Usually joining means adding data from "user's" databases to "central".
You can use code from your example for automation, but you should prepare data for joining.
Avatar of Ianski

ASKER

thats my first project in Access so sry if I didnt explain correctly.
So by prepare data for joining do you mean linking databases?
14064202.jpg
No, I mean adding some unique IDs for identification of source DB. If you have many tables - you should add these two fields (user ID and Record ID) to every table in main DB.
I can't understand how you can copy/paste data from user DB to main. You shoud also correct references i¿ you have some autonumber IDs
Avatar of Ianski

ASKER

right, imagine one of my engineers wants to work from home this week. As I cant get server, I send him an empty database (empty copy of master) so that he could type in another strategy in it. When he finish he send it back to me and Id merge it with master one.
So id have to copy all existing rows from all tables in his version to master (no dupes) starting from one row in master table 'textbox'
I think you could have too many problems with this approach.
For example:
During homework user will add some new records to table textbox and then delete one or more (let Strategy will be 10,11,13,15). In all other tables you have reference to this table. When you are adding data to main table, autonumber field will be (if your textbox table will be unchanged) 10,11,12,13. But references in other tables will be unchanged and you should have method for correcting them. And you will always have problems when home users will be more then one.
Avatar of Ianski

ASKER

users get a form with empty database and they add one strategy per their form/database eg one main primary key in textbox. There is no autonumber - primary key is equal to unique predefined strategy number.
Im sure there is a way to connect via ADODB or something just to copy all rows from one database to another one /no dupes/
It is not a problem, if references will not be changed.
Can you upload empty DB (central) with tables and another one with one strategy filled (with sample data)?
Avatar of Ianski

ASKER

didnt upload any pics but commented them out
login/pass: jan

cheers
2dbs.zip
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ianski

ASKER

thanks for help. Ill analyse it tomorrow. Any idea how else could I sort out my lookup fields?
This is not pure lookup, but multivalued field - Failure modes covered - in table Maintenance Activities. Are you sure it is nesessary? You can't use such field in append or update query.
Avatar of Ianski

ASKER

OK thanks. looks good. Could you show me on one of those tables how would you do sort out lookup field using separate table? Or should I start a new question?
Due to EE rules you should start new question.
But, as I've mentioned in last comment, problem is in multivalued lookup fields, not in simple lookup fields.
You can sort values in form without doing it in table.