Finding Data

k209310

Registered User.
Local time
Today, 09:30
Joined
Aug 14, 2002
Messages
184
How would i go about designing a VB routine to compare two tables` data.

For example take the field from the first table and compare it to the fields in the second table if its found then give a message. The take the second set of data and so on.

Hope this makes sense

Chris
 
Are you trying to evaluate on a row by row basis?
 
kind of yeah. I just need to find if there is duplicate data in the two tables if there is other stuff happens but that is irrelevant for the example

I have been playing about with loops to compare data.

So far i have two loops one inside the other. The first reads the first field from the first table then loops throught the second table comparing this bit works fine. However once all of the data is read in the second table im not sure how to get the second loop to exit and move on to the second set of data in the first table. Does any of this make any sense at all?

This was just the way i had approached the problem. I cant rally use any queries i dont think becasue the tables are a flat tables with no primary keys.

Chris
 
You could use a third loop using the

Code:
For Each Field in MyFields
   Your Loop 1
   Your loop2
Next

structure
 
Thanks im getting there now using the loops i was just wondering if i was doing it correctly - thaks for the help.

I have managed to get the loops working - i think - however for some bizzare reason i have put mesages in to tell me the data it is searching - ie the data in the two fields. This idea was fine when i wasnt getting the code to work however now it seems to be and is currently looping through 1550 sets of data in each table. I make this over 2 million messages. Im now deciding weather or not to quit and start again - i didnt save th code or sit with my finger on the escape button for god knows how long.

Great marverlous fantasic!!

thanks for teh help tho

Chris
 

Users who are viewing this thread

Back
Top Bottom