Access a query without opening Access

  • Thread starter Tired and Confused
  • Start date
T

Tired and Confused

I have a db with several dozen queries. I need a non-technical person, who
is also not authorized to see all the info in the db, to run one query each
day.

Is there any way to launch a query without being in the query view of
Access? Or is there a way to have a single query in the query window whuch
has sub queries not visible or in another location?
 
J

John W. Vinson

On Fri, 8 Jan 2010 15:11:01 -0800, Tired and Confused <Tired and
I have a db with several dozen queries. I need a non-technical person, who
is also not authorized to see all the info in the db, to run one query each
day.

Is there any way to launch a query without being in the query view of
Access? Or is there a way to have a single query in the query window whuch
has sub queries not visible or in another location?

One way is to create a Macro (let's call it RunIt) that has two lines: one to
use the RunQuery action to execute the query (which should not have any
parameters), and then a Quit action to close the database.

You can open Access using either a shortcut or Windows Secheduler with a
command line such as

"C:\Program Files\Office\Office12\msaccess.exe" "E:\path\mydb.mdb" /x RunIt

The /x switch causes Access to open running that macro.
 
D

David W. Fenton

On Fri, 8 Jan 2010 15:11:01 -0800, Tired and Confused <Tired and


One way is to create a Macro

You could also write a VBScript that wouldn't even open Access at
all -- you'd just use DAO to execute the query in the database.
 
V

VWP1

You can run a saved query through VBA behind a form, with the VBA either
containing the SQL instead of a saved query, or having the VBA run the saved
query. You can do this from a different form than the one with the delicate
information. If using Access 2007, you use the wizard and create a macro,
then convert the macro to VBA, if needed.
 

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