Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 10:28 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple database help

okay i will try to keep this short, sweet and non-confusing.

I had one database...i made two copies of it so now i have 3 databases. I want each AREA of my organization to have their OWN copy. There will be a MASTER copy that we have that has ALL employees. The other two copies will have only certain employees filtered by their organization code. I got all that to work fine. The problem is the main database which is a work tracking database. I have used VBA to import all the records into a table for each resource area. (ex / table1 has resource area 1's records, table2 has resource area 2's records...and the main work tracking table needs to get those records into it). So I got the importing to work great. On Open it pulls the records into the tables. Now I got to APPEND the new records from each (table1, table2) into work tracking, AND update any records that may have changed. So I created an APPEND TABLE QUERY by using the Find Unmatched query wizard and created an UPDATE query where it locates all records with matching RECORD ID's (the primary key for all 3 tables...an autonumber field)....the problem is this: The people working in the main work tracking and the people in the resource areas all creating records at the same time in multiple databases are creating many of the same AUTONUMBER fields so when it goes to update or import new records....many are getting missed or updated with the wrong information. I dont have anything else in the tables 17-18 fields that can BY ITSELF distinguish the records as unique. Is there a way to make the query find records that are unique (Find Unmatched) based on ALL fields....in other words it looks at the WHOLE record and compares ALL fields and only if the record is unique in that way does it append it...and how do i make it not update over the top of a totally different record that has the same record ID...very difficult for me.... any help would be appreciated :(

 
Old April 17th, 2006, 03:05 PM
Registered User
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could do that, but that may be a bit more than you might have to do.

One approach I might take with this is...

Have a field in the table, and that field gets updated a bit differently based on the database that is creating that record. So, in Database1, that field might be the Record Number, & "DB1". So it might look like this....

DB1-1 Sam Jones
DB1-2 Fred Smith

etc....

Then, you set that field to be indexed and no duplicates in the main database, then when you append, it won't write over existing records.

You can also, when appending the records, and a duplicate is found, check for what has changed on that particular record, and mark it like that.



John





Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple records in database svk SQL Language 1 May 18th, 2008 03:59 AM
Multiple Database Connections rit01 ASP.NET 1.x and 2.0 Application Design 6 September 20th, 2006 12:42 PM
Multiple database tables akibaMaila VB.NET 2002/2003 Basics 0 September 27th, 2005 11:19 AM
multiple database connections markhardiman Classic ASP Databases 7 September 9th, 2004 05:15 AM
Multiple Database query nlicata SQL Language 1 August 15th, 2003 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.