473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running Access Queries in Excel

I want to be able to run multiple access queries on a single microsoft excel worksheet.

Ideally I want to define what queries i want in excel and import the results of all queries one after another.

Can anyone suggest a good book to help me develope this? or maybe point me in the right direction?
Nov 6 '07 #1
5 3973
ADezii
8,834 Expert 8TB
I want to be able to run multiple access queries on a single microsoft excel worksheet.

Ideally I want to define what queries i want in excel and import the results of all queries one after another.

Can anyone suggest a good book to help me develope this? or maybe point me in the right direction?
To Execute a Query from a Command Button on an Excel Worksheet, set a Reference to the Microsoft Access XX.X Object Library, then place this code in the Button's Click() Event:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton1_Click()
  2. Dim objAccess As Object
  3.  
  4. Set objAccess = GetObject("C:\Test\Test.mdb")
  5.  
  6. objAccess.Visible = True
  7.  
  8. objAccess.DoCmd.OpenQuery "qryInvoice"
  9.  
  10. objAccess.Quit
  11. Set objAccess = Nothing
  12. End Sub
Nov 7 '07 #2
To Execute a Query from a Command Button on an Excel Worksheet, set a Reference to the Microsoft Access XX.X Object Library, then place this code in the Button's Click() Event:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton1_Click()
  2. Dim objAccess As Object
  3.  
  4. Set objAccess = GetObject("C:\Test\Test.mdb")
  5.  
  6. objAccess.Visible = True
  7.  
  8. objAccess.DoCmd.OpenQuery "qryInvoice"
  9.  
  10. objAccess.Quit
  11. Set objAccess = Nothing
  12. End Sub
Thanks for this, but i want results to pull through onto a excel spreadsheet and I want multiple queries to pull through.

Any ideas anyone?
Nov 7 '07 #3
ADezii
8,834 Expert 8TB
Thanks for this, but i want results to pull through onto a excel spreadsheet and I want multiple queries to pull through.

Any ideas anyone?
I imagine then, that what would be involved is fairly complex Automation Code. Why not Export the Query results to an Excel Spreadsheet(s) within Access?
Nov 7 '07 #4
I imagine then, that what would be involved is fairly complex Automation Code. Why not Export the Query results to an Excel Spreadsheet(s) within Access?
I really wanted to be able to specify what queries I want to pull in the excel spreadsheet. In additional use filter in excel to filter results by cost centre. I know it can be done because I have seen it working.

I have recently purchased a book online call integrating access and excel but I am not sure how good it will be. I really don't know where to start the only VBA I have used is in access.
Nov 8 '07 #5
ADezii
8,834 Expert 8TB
I really wanted to be able to specify what queries I want to pull in the excel spreadsheet. In additional use filter in excel to filter results by cost centre. I know it can be done because I have seen it working.

I have recently purchased a book online call integrating access and excel but I am not sure how good it will be. I really don't know where to start the only VBA I have used is in access.
The same VBA would equally apply in Excel, you would simply have a different Object Hierarchy, and the Reference would be to the Microsoft Access XX.X Object Library.
Nov 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jsudo | last post by:
I have a Access database with a large amount of records (close to 500,000) that I would like to export to Excel. I found out that Excel has the capability of of about 65,000 rows so I know I...
2
by: Jim S | last post by:
To my surprise and chagrin, newer versions of Access have disabled the functionality that lets users change the data in linked tables that point to a range in an Excel workbook. This is "because of...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
6
by: Mat N | last post by:
Hello access friends, (Originally posted on access.formsprogramming which I think was the wrong place) I'm precalculating a bunch of data for my clients as per a profile I have for each of...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
3
by: austin1539 | last post by:
I am trying to run an Access query from Excel. The query, called "ProdActs1" works in Access and is run from using information from a table called "Queries". When a button is clicked in Excel, data...
3
by: Richard Hollenbeck | last post by:
I hope this isn't too confusing. The following query runs pretty fast by itself, but when I want to use it in a report (pasted below the query), it takes at least fifteen seconds to run! Then I...
0
by: sandervanee | last post by:
Hello, I am trying to export several Access 2003 select queries to Excel 2003 using an Access macro. I'm using the macro command "TransferSpreadsheet" to export the queries. This going quit well,...
14
by: harshakusam | last post by:
Hi All, Iam new to access Can some one pls help me pls.. My database is :- Access I connect to my database using ODBC using oracle RDB driver. I have a watchlist.mdb file. Which has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.