New twist on a command button for queries- I know this can be done

  • Thread starter chris23892 via AccessMonster.com
  • Start date
C

chris23892 via AccessMonster.com

Hi all! Here's a new twist:

I want to create a command button in Excel that will run a query in my
database.

Here's why:

Our data base is not that locked down, I don't want everyone poking around in
this. What I've done is create a query to run the data output that people
want. I already have a command button in my form in our data base to run this,
export it to a nice neat spreadsheet.

What I need is to create a tab in this spreadsheet with a command button that
will run this query in my database so people don'r poke around in the actual
data base.

I'm having issues pointing Excel to the query in VBA. I know this can be done.


Any thoughts?
 
K

Klatuu

It would be easier to use MSQuery and pull the data from Access into your
spreadsheet.
 
K

Klatuu

It really is very simple.
From the Excel menu.
Data, Import External Data, New Database Query.
You will get a Choose Data Source dialog
Select MS Access Database* and Click OK
Now naviagte to the mdb file where where the data is. If your database is
split, don't use the front end, use the back end where the data actually is.
Now just follow the wizard and create your query

Once you have named and saved the query and the data has been imported into
your spreadsheet. All you need to do is select a cell anywhere in the data
area and select Data, Refresh Data to update the data in the spreadsheet.

--
Dave Hargis, Microsoft Access MVP


chris23892 via AccessMonster.com said:
I have this in the excel forum...no replies yet :(
It would be easier to use MSQuery and pull the data from Access into your
spreadsheet.
Hi all! Here's a new twist:
[quoted text clipped - 15 lines]
Any thoughts?
 

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