open and run access query in excel

L

lee

hi

I have a query based on table sales and the results of the query are
as follows


department sales %
A 12000 20
B 1500 30%
C 400 40%

now my users donot have any access knowledge . so how would i have
them run this in excel.

i would need a macro or a code in excel which will automatically run
the query in access without opening the access database.

Please help with this code- step by step

Thanks much in advance. ASAP Thanks
 
A

Arvin Meyer

How about an Access shortcut on the desktop to run the query? Wouldn't that
work even better?

Simply open the database, and drag the query to the desktop from your
database container. When you double-click it will open up in Access. You can
also run a macro from the desktop that will put the results in an Excel
spreadsheet. Create an Access macro to put the query results in an Excel
sheet, then drag the macro to the desktop. Access will open and dump the
data into Excel.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access Solutions", published by Wiley
 
L

lee

How about an Access shortcut on the desktop to run the query? Wouldn't that
work even better?

Simply open the database, and drag the query to the desktop from your
database container. When you double-click it will open up in Access. You can
also run a macro from the desktop that will put the results in an Excel
spreadsheet. Create an Access macro to put the query results in an Excel
sheet, then drag the macro to the desktop. Access will open and dump the
data into Excel.

Thanks but i donot want users to open access report or query ; can i
set up a connection from excel to access. i
 
A

Arvin Meyer

How about an Access shortcut on the desktop to run the query? Wouldn't
that
work even better?

Simply open the database, and drag the query to the desktop from your
database container. When you double-click it will open up in Access. You
can
also run a macro from the desktop that will put the results in an Excel
spreadsheet. Create an Access macro to put the query results in an Excel
sheet, then drag the macro to the desktop. Access will open and dump the
data into Excel.

Thanks but i donot want users to open access report or query ; can i
set up a connection from excel to access. i

Sure, using automation. From the outside in, it's a bit more difficult, but
the code is similar to (search on the word automation):

http://www.mvps.org/access/_vti_bin/shtml.exe/search.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access Solutions", published by Wiley
 

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