Query Access then cycle results using Excel VBA

big_c_2006

New Member
Joined
Oct 13, 2006
Messages
3
I am wondering if there is a way to query access with a range, then return all values that match this query. Is there some sort of next command that can be used? or can you use a variable with the () at the end (brain forgot the proper word for it) to simple add all values the query finds? As well, this will be done in Excel VBA
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
What exactly do you mean?

Do you want all the values in the range to be the criteria for the query?

Or do you want to run a query with each individual value as the criteria?
 

big_c_2006

New Member
Joined
Oct 13, 2006
Messages
3
I want to run a query for a specific value in a column within an access database. using the Select var Where ____ command I know I can return a single value. There will be multiple values in the access database that match this query. I want the program to return all of these values. The problem I am having is that I am yet to learn how to return more than 1 value from an access query.

I am wondering if a loop is necessary or if there is a function within the ADODB commands that allows you to get the next value that matches the query.

so basically, there will be a single search criteria but there will be many values in the access database that are within this subset.

hopfully this makes more sense!
 

Forum statistics

Threads
1,141,413
Messages
5,706,301
Members
421,441
Latest member
VapesRub

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top