tblEntities:
ID Autonumber
EntityName Text
State Text
Promoter Text
Category Text
tblSYards:
Ent ID Number
SY Year Number
CCCat ID Number
SY Month Number
SYards Number
Crosstab query:
TRANSFORM Sum(tblSYards.SYards) AS SumOfSYards
SELECT tblSYards.[CC Cat ID], tblEntities.ID, Sum(tblSYards.SYards) AS [Total Of SYards]
FROM tblEntities INNER JOIN tblSYards ON tblEntities.ID=tblSYards.[Ent ID]
GROUP BY tblSYards.[Ent ID], tblSYards.[SY Year], tblSYards.[CC Cat ID], tblEntities.EntityName, tblEntities.ID, tblEntities.State, tblEntities.Promoter, tblEntities.Category
PIVOT tblSYards.[SY Month];
When I clicked on Add Existing Fields to my subform, only the row headings field and column field (with sum fields) were listed. I don't code SQL, but I went in and added tblEntities.ID to the Select portion of the query. The query works fine and includes the ID in a column of the crosstab query and in the subform. However, when I open the main form that includes the subform, I get this message:
You can't use a pass-through query or a non-fixed column crosstab query or a non-fixed column crosstab query as a record source for a subform or subreport. Before you bind the subform or subreport to a crosstab query set the query's ColumnHeadings property.