DrChocolate
New member
- Local time
- Today, 14:38
- Joined
- Feb 21, 2012
- Messages
- 7
Greetings:
As the title suggests, I want to move selected rows of query #1 into query #2. The reason for this is that query #2 will "union" with other queries.
Here's the first query (for example)
12 1 5
13 1 6
18 2 9
23 3 10
38 4 38
22 4 39
28 4 40
I want to choose ONLY the rows that have the first occurrence of a number in column two. Thus, after scanning the list, query #2 would read
12 1 5
18 2 9
23 3 10
38 4 38
My solution is not very elegant. I'd iterate query #1, take it into an array in VBA, use VBA to choose only the first occurrence, move those values into a table, and then query that table. This isn't good because it forces me to create a dummy table as a transition from the array to query #2. Clumsy and ugly.
Is there a simple but more direct way to accomplish this? Thank you!
DrC
P.S. I'm a relative beginner at VBA so if you might please be fairly specific in an answer rather than give general directions, I'll put you in my will.
As the title suggests, I want to move selected rows of query #1 into query #2. The reason for this is that query #2 will "union" with other queries.
Here's the first query (for example)
12 1 5
13 1 6
18 2 9
23 3 10
38 4 38
22 4 39
28 4 40
I want to choose ONLY the rows that have the first occurrence of a number in column two. Thus, after scanning the list, query #2 would read
12 1 5
18 2 9
23 3 10
38 4 38
My solution is not very elegant. I'd iterate query #1, take it into an array in VBA, use VBA to choose only the first occurrence, move those values into a table, and then query that table. This isn't good because it forces me to create a dummy table as a transition from the array to query #2. Clumsy and ugly.
Is there a simple but more direct way to accomplish this? Thank you!
DrC
P.S. I'm a relative beginner at VBA so if you might please be fairly specific in an answer rather than give general directions, I'll put you in my will.