views:

27

answers:

2

I am attempting to sum over a detail grouping on a specific field in Microsoft Access, and assign that sum to a field in the general grouping. When I try to run the report, I get an "Invalid Column Name" error with the detail field getting the error. Has anyone previously encountered this? If so, any ideas what might be causing it or how to solve it?

+1  A: 

Don't name a field detail because that is a reserved word (used for a Form or Report property) in Access. See Problem names and reserved words in Access

Name the field something else. If changing the name is not an option, try enclosing the field name in square brackets to let Access know detail is a field rather than the report property.

HansUp
A: 

So, the problem was that I was attempting to perform aggregate operations on report fields, rather than on fields directly from the query. I solved the problem by performing some CASE WHEN THEN ELSE statements on fields from my query to form new query results. Then, Access accepted performing aggregate ops on the direct query results.

I've accepted HansUp's answer because it was also a valid response.

badpanda