473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do I automate the comparison process of two tables?

Hello,

I am currently trying to automate the process of updating my list on SharePoint from the weekly outputs of a forecast model I use on Excel. I also, need the information on Access.


As of now in Access, I have a table(Table A) that is linked to a list I have in SharePoint and another table (Table B) that is linked to a table I have in my Excel Forecast model.

My goal, is to write out a process in VBA that would automatically compare Table B to Table A and update Table A's values to Table B's, as well as create values in Table A that aren't there.

I was wondering what the best logical approach to this would be?

Thank you very much for your help.
Oct 29 '14 #1
2 1002
twinnyfo
3,653 Expert Mod 2GB
zzzz243,

This can be tricky, because you do not mention how accurate your data is and how much on the Spreadsheet may be different from the SharePoint List.

Here's a general process that I would start with:

1A. If you have a unique index for these records, you can insure accuracy much better than if not. This should be a standard practice anyway. If you don't have indexes, this could become very sticky.

2A. Create a recordset for the Spreadsheet. Then cycle through the records one by one. As you cycle through, use the index of the record in the Spreadsheet as a search criteria for a second recordset based on the SharePoint list. If it finds a record, update all the values in the Spreadsheet to the SharePoint List. If there is no corresponding record, then add a new record to the SharePoint List.

1B. If you do not have indexes, this can get ugly very quickly. Create two recordsets--one for the Spreadsheet, one for the SharePoint list. Make sure that the queries used to create these recordsets are sorted identically (to the maximum number of levels possible, so all records should correspond).

2B. Cycle through both recordsets record by record and hope that the records match. You will have to evaluate each set of records individually. However, you may have problems with new records in the Spreadsheet. Would all the new records be at the end? Will there ever be a case in which the SharePoint list has new records that are not in the Spreadsheet?

Lots of complexities in the second scenario.

Give us more detail and try some things out and see what you come up with. We'll be glad to troubleshoot and work toward a solution.
Oct 30 '14 #2
zmbd
5,501 Expert Mod 4TB
+ Version of Office?
+ You lack details of the table structures such as primary keys, data types, etc...

Really no VBA needed:
+ Look at the wizards, there is a wizard the will compare two tables for missing entries. It writes a fairly decent query. Set it up to compare your tbl_sharepointlink against tbl_excelfilelink, to return values from tbl_excelfilelink.
+ Once you are sure the proper values are being returned by the select-query, convert it to an append-query, appending to tbl_sharepointlink.
+ sync the database to sharepoint.
+ You can, of course, have a VBA script that runs these steps for you

(^_^)
Oct 30 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil S | last post by:
I used the Migration Workbench for Oracle 9.2 Client to migrate the tables in an Access 2K back-end database to Oracle. (The Migration Workbench is intended to automate the process of migrating...
25
by: MLH | last post by:
In an earlier post entitled... "A97 closes down each time I open a particular report" it has been suggested that I rebuild problematic table - one in which some corruption has occurred. I...
4
by: Elhanan | last post by:
hi.. i'm a database kind of guy, when ever i apprached a new project i always looked at it from tables point of view, how can normlize correcly and them moved to the objects and desgined them...
3
by: deltauser2006 | last post by:
My database consists of information which is updated every quarter. Forms will compare data from the present quarter to quarters past. I need a way to make the database save a copy of itself every...
3
by: Odawg | last post by:
Hello All Database (Access) Guru's, I am a novice when it comes to databases and I know enough to get simple information for my needs. With that said, I was given an opportunity for improvement...
0
by: jrhowcroft | last post by:
I have a number of databases in MS Access 97. Some tables in these databases are linked to ODBC tables in Oracle9/10. We would like to change the user name and password on the Oracle tables so each...
4
by: coolhand729 | last post by:
Okay, this is not your normal two table query (at least it doesn't seem that way to me). I'm using Access 2000 on Windows XP. I have two tables in access. One is a table with addresses of club...
4
by: Cirene | last post by:
i am creating an asp.net auction website how do i create a process that will "end" the auction when it's time obviously i don't want to sit at a browser and keep refreshing the page i'm not...
8
by: brucedodds | last post by:
I've inherited an A2003 application with linked SQL Server 2000 tables in the back end, using the Microsoft SQL Server ODBC driver. We've set up a test SQL Server database. I'd like to automate...
1
by: Snayak | last post by:
Suppose some process are running in the back end unix environment, if any services is getting down then ,what we are doing is manually we are logging to that environment through putty and and then...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.