Parameter in a Crosstab Q

Boo

Registered User.
Local time
Yesterday, 23:18
Joined
Aug 30, 2004
Messages
32
I have created a Crosstab Q. I have a Code field that I need criteria for. The Code field is also the column field, so I added the Code field again, set the Grouping to Where, and typed in my criteria. So far, it works. When I try to put a parameter in the criteria referenceing a text box on a form, no worky.

The data in the field is a year and the a 2 digit Code. Example: 200403. I want only the first 4 digits (the year) to be the criteria.
So my parameter is
Like Forms![FormName]![Year] & "*"

The extra complication with the Like expression is not the whole problem. I can't get even a straight forward parameter to work.

Any help would be greatly appreciated

BooHoo
 
Last edited:
Parameters in crosstab column headers are tricky ....

Which version of Access?
Because the crosstab column headings are derived from the parameter it cannot work the way you describe.
I have provided 'hard-coded' column headers to a cross-tab query before now but it is a rather messy way of doing the job [and I would need to dig out some ancient notes to recall how it was done].
 
In a crosstab query, you need to declare the data type of the parameter.


In query Design View, choose menu Query, Parameters...

In the dialog box that pops up, type the parameter [Forms]![FormName]![Year] in the first column, and select Text in the next column. Click OK.
 

Users who are viewing this thread

Back
Top Bottom