473,746 Members | 2,589 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3352

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********@hotm ail.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
17669
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
10087
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 editable. But that is not the way I want it. Any suggestions?
4
8134
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 to build the crosstab query from. In the select query I'm prompting for a specific quarter but when I go to run the crosstab it doesn't seem to like the parameter that has been put on the select query and returns a message of "The Microsoft Jet...
2
2537
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 SELECT; SELECT xTab.FirstOfPRIORITZTN_STATUS_NAME, xTab., iif(IsNull( xTab. ), 0, xTab.) AS ,
14
3495
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. However, the expectation changes - it may be 60% for a while, then change to 50%. Initially, I was averaging the expectation, along with the productivity, but what I'm being asked is to look at the average productivity/performance compared to...
2
5454
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 ... mySQL = "" mySQL = mySQL & "TRANSFORM Sum(Transactions.Hours) AS SumOfHours " mySQL = mySQL & "SELECT Transactions.Activity" & myActSecond & " as myActivity, Sum(Transactions.Hours) AS myHours " mySQL = mySQL & "FROM Transactions " mySQL = mySQL...
1
5968
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 along the top row and the data items below it. This would give a better appreciation of changes over time. I apologise if I'm missing something obvious. Phil
2
1688
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 problem lies with my getting the output of the crosstab into one field in the label template. Basically, my crosstab of cloth sizes and quantities, which could be in
4
6479
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 flat file. Ideally I would like to be able to just select the Last 2 Columns of the Crosstab query as inputs to the Select query WITHOUT having to go in month after month and manually change it... I may be asking a bit much here but is there a...
0
8974
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8800
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9508
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9218
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8229
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4586
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.