Cross Tab query needs data from a form

G

Guest

I need to (somehow) get data from a table and manipulate it into monthly and
quarterly reports. I would like to choose the year from a form. I can
create the report as a cross tab query, but I can't get it to hook to the
form. I've tried creating the query first and then a query on top to look
for the year... that gives me the error: The Microsoft Jet Database engine
does not recognize '[Forms]![frmTest]![cmbYear]' as a valid field name or
expression.

I can grab the data with the form, if I don't use a cross tab. If I try to
do the cross tab after I've attached the form, then I still get the same
error. So I know the form hooks to a query and can read the field correctly.

How do I make these pieces work together? Is there a way?

Thanks for any help you can provide.
 
J

John W. Vinson

I need to (somehow) get data from a table and manipulate it into monthly and
quarterly reports. I would like to choose the year from a form. I can
create the report as a cross tab query, but I can't get it to hook to the
form. I've tried creating the query first and then a query on top to look
for the year... that gives me the error: The Microsoft Jet Database engine
does not recognize '[Forms]![frmTest]![cmbYear]' as a valid field name or
expression.

I can grab the data with the form, if I don't use a cross tab. If I try to
do the cross tab after I've attached the form, then I still get the same
error. So I know the form hooks to a query and can read the field correctly.

How do I make these pieces work together? Is there a way?

Thanks for any help you can provide.

Crosstab queries MUST have their parameters declared. You can always declare
parameters, but for most queries it's optional.

To declare parameters, open the Query in design view. Right mouseclick the
grey background of the tables, and choose Parameters. Put

[Forms]![frmTest]![cmbYear]

in the left column and select its datatype (Number??) in the right column;
repeat for all the parameters.

John W. Vinson [MVP]
 

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