Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! Struggling with looping thru tables 3

Status
Not open for further replies.

Andande

Programmer
Jan 22, 2002
5
US
I have 2 tables that I'm trying to loop thru. I grab the contract number from the first table and loop thru the second table to see if I find it there. If not, then move to the next contract number in the first table and find it's match in the second table and so on. Once I find the match, I have to copy that data to a third table. I don't even want to show the code that I've been working with because it's all confusing now and none of it is working. I need to start from scratch. Can anyone out there help me, PLEASE. Any help with this is greatly appreciated. Thanks.
 
Why not joining your tables in a query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Can I do that? This is going to be part of an automated process. I am creating a job to run monthly to copy contract numbers from one database to another. You gave me an idea, although I may need more help. Is that oK??

Thanks
 
Creating a join (in a query) between the tables can show all the table1.contracts with a matching contract in the second table. Through a make-table-query, you can put the result in a third table (although that would mean storing the already available information again)

Pampers [afro]
Keeping it simple can be complicated
 
...or as another option.
Make a union Query, then run the Find Duplicate wizard,
based on the field in question.
When asked if you'd like to include any other fields,
(after the dup search field has been selected),
choose one that will identify, which table is which...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top