How to run a SAVED SELECY query in VBA

ThisIsntMyRealName

Board Regular
Joined
May 23, 2009
Messages
69
Hey guys, I want to run a saved SELECT query in ACCESS 2007 VBA without opening it, but the .EXECUTE statement only works with action queiries, any idea how to execute this one? I do not want to code the SQL in VBA first as its already saved in the navigator.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
My question is WHY? There should be no reason to run a select query unless you are wanting to view it (open).
 
Upvote 0
You can't execute a select query, do you mean open it and get the data from it?

If you do then you can use various methods, eg DAO, ADO,.

It really depends where you are dong this and where you want the results.
 
Upvote 0
Okay, I'm running a bunch of ACTION queries via EXECUTE. After that, I need to refresh a SELECT query in the ACCESS navigator menu (at least i think i do) to update the data there, or do I? I'm not sure, but I think i need to refresh some of those SELECT queries.
 
Upvote 0
No you don't.

The results from SELECT queries aren't 'saved', it's the query itself.

Whenever you open a select query it uses the current data.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,317
Members
452,905
Latest member
deadwings

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
Back
Top