[/B]
[B]Specify column headings[/B]
Since the column headings are derived from a field, you only get fields relevant to the data. So, if your criteria limits the query to a period when Nancy Davolio made no sales, her field will not be displayed. If your goal is to make a report from the crosstab, the report will give errors if the field named "Davolio, Nancy" just disappears.
To solve this, enter all the valid column headings into the Column Headings property of the crosstab query. Steps:[LIST=1]
[*]In query design view, show the Properties box (View menu.)
[*]Locate the Column Headings property. (If you don't see it, you are looking at the properties of a field instead of the properties of the query.)
[*]Type in all the possible values, separated by commas. Delimit text values with quotes, or date values with #.
[/LIST]For the query above, set the Column Headings property like this (on one line):
[INDENT]"Buchanan, Steven", "Callahan, Laura", "Davolio, Nancy", "Dodsworth, Anne", "Fuller, Andrew", "King, Robert", "Leverling, Janet", "Peacock, Margaret", "Suyama, Michael"
[/INDENT]
Side effects of using column headings:
[LIST]
[*]Any values you do not list are excluded from the query.
[*]The fields will appear in the order you specify, e.g. "Jan", "Feb", "Mar", ...
[/LIST]Where a report has a complex crosstab query as its Record Source, specifying the column headings can speed up the design of the report enormously. If you do not specify the column headings, Access is unable to determine the fields that will be available to the report without running the entire query. But if you specify the Column Headings, it can read the field names without running the query.