Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: crosstab query


Message #1 by "Joseph Valdez" <e-valdez@a...> on Sun, 23 Mar 2003 15:40:46 -0600
Can I crosstab query be used in a report?
 I created a crosstab query but when I used it as a reference in a report, I
received an error message. "No fields selected!"

Why?

Message #2 by "zak willis" <zak@z...> on Mon, 24 Mar 2003 10:58:41
> Can I crosstab query be used in a report?
 I created a crosstab query but when I used it as a reference in a report, 
I
received an error message. "No fields selected!"

Why?

Yes, a crosstab query can be used in a report. There is however, a 
limitation on using a crosstab query. I can't remember exactly what it is, 
but I think it is something to do with Access knowing what columns will be 
generated prior to building the report. For example, using a crosstab with 
parameters is a no no. The way to identify whether or not your crosstab 
query will work in a report is to open a report in design view, then 
physically drag the crosstab query into your report. If Access creates the 
crosstab, it will work, otherwise you cannot do it. Sorry if this is not 
very helpful. I had the same problem, and I decided to use VBA and export 
it to Excel.
Regards,
Zak Willis
Message #3 by "Joseph Valdez" <e-valdez@a...> on Mon, 24 Mar 2003 10:52:00 -0600
Thanks! I thought it was something I did wrong. I think it may be a good
idea to export it to excel the results of the query. Do you have any code in
your library that uses that method that I can apply? I have not done any of
that way yet.

-----Original Message-----
From: zak willis [mailto:zak@z...]
Sent: Monday, March 24, 2003 10:59 AM
To: Access
Subject: [access] Re: crosstab query


> Can I crosstab query be used in a report?
 I created a crosstab query but when I used it as a reference in a report,
I
received an error message. "No fields selected!"

Why?

Yes, a crosstab query can be used in a report. There is however, a
limitation on using a crosstab query. I can't remember exactly what it is,
but I think it is something to do with Access knowing what columns will be
generated prior to building the report. For example, using a crosstab with
parameters is a no no. The way to identify whether or not your crosstab
query will work in a report is to open a report in design view, then
physically drag the crosstab query into your report. If Access creates the
crosstab, it will work, otherwise you cannot do it. Sorry if this is not
very helpful. I had the same problem, and I decided to use VBA and export
it to Excel.
Regards,
Zak Willis



  Return to Index