473,388 Members | 1,524 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,388 software developers and data experts.

Edit and output a crosstab query to a file

Hi everyone,

I found the Access reports too limited to do what i wanted so i created
a module to export a crosstab query to an excel file, and then i modify
it as i want. My problem is that i created a unique query for every
"sector", saved them, and select the right one according to the user's
choice.

What i'd like to do is to create the crosstab query directly in VBA,
change the WHERE part for the sector i want to show and output it to
the excel file with or without saving the query (if not i'd like to
erase if afterwards, or replace it everytime).

I dont think the runSQL command would work since it only runs action
queries, and i dont think that it is possible to make a crosstab table
neither. Could anyone help me?

Thanx alot,

Mike

Nov 16 '06 #1
2 3327

Mike wrote:
Hi everyone,

I found the Access reports too limited to do what i wanted so i created
a module to export a crosstab query to an excel file, and then i modify
it as i want. My problem is that i created a unique query for every
"sector", saved them, and select the right one according to the user's
choice.

What i'd like to do is to create the crosstab query directly in VBA,
change the WHERE part for the sector i want to show and output it to
the excel file with or without saving the query (if not i'd like to
erase if afterwards, or replace it everytime).

I dont think the runSQL command would work since it only runs action
queries, and i dont think that it is possible to make a crosstab table
neither. Could anyone help me?

Thanx alot,

Mike
why not create the query in your code, open a recordset based on it,
and then send the whole thing to Excel with this:
http://www.mvps.org/access/modules/mdl0035.htm

Nov 16 '06 #2
On 16 Nov 2006 14:11:25 -0800, pi********@hotmail.com wrote:
>
Mike wrote:
>Hi everyone,

I found the Access reports too limited to do what i wanted so i created
a module to export a crosstab query to an excel file, and then i modify
it as i want. My problem is that i created a unique query for every
"sector", saved them, and select the right one according to the user's
choice.

What i'd like to do is to create the crosstab query directly in VBA,
change the WHERE part for the sector i want to show and output it to
the excel file with or without saving the query (if not i'd like to
erase if afterwards, or replace it everytime).

I dont think the runSQL command would work since it only runs action
queries, and i dont think that it is possible to make a crosstab table
neither. Could anyone help me?

Thanx alot,

Mike

why not create the query in your code, open a recordset based on it,
and then send the whole thing to Excel with this:
http://www.mvps.org/access/modules/mdl0035.htm
This method will no longer work in A2002 (if patched after 18 Oct 2005) and
A2003. MS have removed this functionality from Access due to some sort of legal
dispute. (Can't recall the details)

(from KB904018)
INTRODUCTION
Microsoft has released an update for Microsoft Access 2002. This update removes
the functionality in Access 2002 that lets users add new data to or edit
existing data in a linked Microsoft Excel worksheet.

There is workaround code at http://support.microsoft.com/kb/904953/en-us
(KB904953)

Wayne Gillespie
Gosford NSW Australia
Nov 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: libbythomas | last post by:
I created an Access 2000 form from a query. But I cannot edit it. I can flip through the records. If I create a table from the query (maketable) and then create the form from the table, it is...
4
by: Judy | last post by:
I'm using Access 2003 and was wondering if it is possible to have a paramater selection within a crosstab query so that I wouldn't need to build a new table. I have a select query that I'm using...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
2
by: PW | last post by:
I am trying to create a crosstab report in ASP. I'm using ASP/VBScript and Access database. I used Access to create the SQL query, then copied the SQL and embedded it in my ASP like this ... ...
1
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day and display it in a query with each day's date...
2
by: Phil Latio | last post by:
My quandary is this..... I have a label application (Bartender) that I have hooked up to Access, to use the output of a cross tab. I've succeeded in getting the data within Access, but my...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.