Crosstab question

  • Thread starter ryan.fitzpatrick3
  • 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
 
R

ryan.fitzpatrick3

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.
 
R

ryan.fitzpatrick3

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
 
R

ryan.fitzpatrick3

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.
 
A

Allen Browne

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.
 
A

Allen Browne

(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top