Issue with transform query

J

Jack

Hi
I have a query where the parameters are
hardcoded. Based on this qry I have a cross tab query.This was working fine.
However when I put parameters which refers to a form fields in the source
query the cross tab table does not work. The message box displays the
following:

The Microsoft Jet database engine does not recognize
'Forms!frmForecastEntry.txt2FKey1 name or expression.

I would like to know if cross tab does not allow parameter reference to the
source query. If not what is the best approach to solving this issue. Thanks.
 
J

John W. Vinson

Hi
I have a query where the parameters are
hardcoded. Based on this qry I have a cross tab query.This was working fine.
However when I put parameters which refers to a form fields in the source
query the cross tab table does not work. The message box displays the
following:

The Microsoft Jet database engine does not recognize
'Forms!frmForecastEntry.txt2FKey1 name or expression.

I would like to know if cross tab does not allow parameter reference to the
source query. If not what is the best approach to solving this issue. Thanks.

It's always permissible (and usually a good idea) to declare a query's
parameters in its Parameters collection... but for a crosstab query it's
obligatory.

Open the query in design view; right click the grey area behind the tables,
and select "Parameters". Copy and paste the parameter name (e.g.
[Forms]![YourFormName]![Controlname]) in the left column of the grid - it must
match exactly - and specify the datatype of the field in the second column.
 
J

Jack

Thanks John for the great advise. After putting the parameters as per your
advise, it is working great. This was a huge help.
Best

John W. Vinson said:
Hi
I have a query where the parameters are
hardcoded. Based on this qry I have a cross tab query.This was working fine.
However when I put parameters which refers to a form fields in the source
query the cross tab table does not work. The message box displays the
following:

The Microsoft Jet database engine does not recognize
'Forms!frmForecastEntry.txt2FKey1 name or expression.

I would like to know if cross tab does not allow parameter reference to the
source query. If not what is the best approach to solving this issue. Thanks.

It's always permissible (and usually a good idea) to declare a query's
parameters in its Parameters collection... but for a crosstab query it's
obligatory.

Open the query in design view; right click the grey area behind the tables,
and select "Parameters". Copy and paste the parameter name (e.g.
[Forms]![YourFormName]![Controlname]) in the left column of the grid - it must
match exactly - and specify the datatype of the field in the second column.
 

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