Crosstab question

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I made a crosstab query, which works real nice, but in the first query
that leads up to the final crosstab ( i have 3 queries before the
crosstab) I have the item # field criteria linked to a combo box on a
form, so the selection on the combo box is what is searched in the
query. This normally works for me, but it's not working for me in a
crosstab query, anyone know why? And how can I have a form with combo
box selections go into the query and the crosstab be able to read it
without giving an error? Thanks in advance.

Ryan
 
Since I'm relatively new at this, in the parameters I put [Forms!
[frmSMICcodes]![GROUP]

group is the name of the combo box. Is this correct? Do I link the
field in the query to the combo box as well?


If the crosstab query has criteria such as:
[Forms].[Form1].[Combo2]
you must declare that as a parameter.
Explanation:
http://allenbrowne.com/ser-67.html#Param

If that doesn't work for you, another approach is to specify the column
headings:
http://allenbrowne.com/ser-67.html#ColHead

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


I made a crosstab query, which works real nice, but in the first query
that leads up to the final crosstab ( i have 3 queries before the
crosstab) I have the item # field criteria linked to a combo box on a
form, so the selection on the combo box is what is searched in the
query. This normally works for me, but it's not working for me in a
crosstab query, anyone know why? And how can I have a form with combo
box selections go into the query and the crosstab be able to read it
without giving an error? Thanks in advance.
 
Also, in the parameters, do I put that in the crosstab query, or the
query before that?



Since I'm relatively new at this, in the parameters I put [Forms!
[frmSMICcodes]![GROUP]

group is the name of the combo box. Is this correct? Do I link the
field in the query to the combo box as well?

If the crosstab query has criteria such as:
[Forms].[Form1].[Combo2]
you must declare that as a parameter.
Explanation:
http://allenbrowne.com/ser-67.html#Param
If that doesn't work for you, another approach is to specify the column
headings:
http://allenbrowne.com/ser-67.html#ColHead
 
I followed the instructions on column headers and I put in JAN, FEB,
MAR, etc and when I ran the query it said data mismatch.


If the crosstab query has criteria such as:
[Forms].[Form1].[Combo2]
you must declare that as a parameter.
Explanation:
http://allenbrowne.com/ser-67.html#Param

If that doesn't work for you, another approach is to specify the column
headings:
http://allenbrowne.com/ser-67.html#ColHead

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


I made a crosstab query, which works real nice, but in the first query
that leads up to the final crosstab ( i have 3 queries before the
crosstab) I have the item # field criteria linked to a combo box on a
form, so the selection on the combo box is what is searched in the
query. This normally works for me, but it's not working for me in a
crosstab query, anyone know why? And how can I have a form with combo
box selections go into the query and the crosstab be able to read it
without giving an error? Thanks in advance.
 
Ryan, I can't see your query, but perhaps the column names are 1-12 instead
of Jan-Dec.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I followed the instructions on column headers and I put in JAN, FEB,
MAR, etc and when I ran the query it said data mismatch.


If the crosstab query has criteria such as:
[Forms].[Form1].[Combo2]
you must declare that as a parameter.
Explanation:
http://allenbrowne.com/ser-67.html#Param

If that doesn't work for you, another approach is to specify the column
headings:
http://allenbrowne.com/ser-67.html#ColHead


I made a crosstab query, which works real nice, but in the first query
that leads up to the final crosstab ( i have 3 queries before the
crosstab) I have the item # field criteria linked to a combo box on a
form, so the selection on the combo box is what is searched in the
query. This normally works for me, but it's not working for me in a
crosstab query, anyone know why? And how can I have a form with combo
box selections go into the query and the crosstab be able to read it
without giving an error? Thanks in advance.
 
(e-mail address removed)> wrote in message
Also, in the parameters, do I put that in the crosstab query, or the
query before that?

In the lower-level query.
 
Back
Top