troubleshooting Question

Loop match items in two queries

Avatar of Jon Lake
Jon Lake asked on
Microsoft AccessVBA
8 Comments2 Solutions30 ViewsLast Modified:
I need to loop through a dataset for any strings which match strings in another dataset.

I have a query called qry_imp_pplus_cross_ref_table containing several thousand unique records. Each record has a unique string field (text and number combinations) called details_no_wildcard.

Each details_no_record string in qry_imp_pplus_cross_ref_table may match (or match part of) a string called narrative in qry_imp_bankline_adv (which contains several thousand records).

I need a routine which takes each record from qry_imp_pplus_cross_ref_table, loops through qry_imp_bankline_adv for a match to the narrative field. If a match is found I need to have the record id from each table appended to a matching table (e.g. tbl_matching_items). Once it has cycled through using the first record from qry_imp_pplus_cross_ref_table it would loop to the next and search, until it has looped through all records in qry_imp_pplus_cross_ref_table.

I hope you can help. Thanks.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros