Best strategy for this?


G

Guest

I have a table, MtchTbl, with two text fields: DonID and EndwID, which can
contain any number of matches. In VBA, I need to find all the instances of a
particular DonID, say "D100", and place each of the matching EndwID codes
into variables.

How do I get VBA to click through all instances of "D100"? How do I create
variables on the fly, without knowing how many?

I am totally in the dark on this.

Thanks in advance.
 
Ad

Advertisements

D

Duncan Bachen

David said:
I have a table, MtchTbl, with two text fields: DonID and EndwID, which can
contain any number of matches. In VBA, I need to find all the instances of a
particular DonID, say "D100", and place each of the matching EndwID codes
into variables.

How do I get VBA to click through all instances of "D100"? How do I create
variables on the fly, without knowing how many?

I am totally in the dark on this.

Thanks in advance.
You could create a recordset, and open it with criteria that returns
only the D100 records.

Then, create yourself an array and loop through the recordset assigning
the EndwID to the next position in the array.

That'd be the only way to handle the results if you need to have them in
a variable.

What are you trying to accomplish with this task? Could you take the
EndwID results and put them in a temporary table?

Knowing what you are trying to do will help in determining how to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top