I'm stuck with something which doesn't make sense. I have a table of data and I've used a Crosstab query to rearrange it. I need to group things by years and periods, mainly Previous Year and Current Year, but I also want to make it easy to update, so I made a form with three text boxes: Current Year, Previous Year, Next Year. In my query I then made the following formula:
PY_P01: Sum(IIf([Year]=[Forms]![Years]![PreviousYear],[P01],0))
It looks like it should work. Just sum up the P01 column if the Year is the same as in the PreviousYear field in the form Years. Instead if get a message saying:
"The Microsoft database engine does not recognize '[Forms]![Years]![PreviousYear]' as a valid field name or expression."
If I change the form part to just say "2015" it works fine though. Odd.
PY_P01: Sum(IIf([Year]=[Forms]![Years]![PreviousYear],[P01],0))
It looks like it should work. Just sum up the P01 column if the Year is the same as in the PreviousYear field in the form Years. Instead if get a message saying:
"The Microsoft database engine does not recognize '[Forms]![Years]![PreviousYear]' as a valid field name or expression."
If I change the form part to just say "2015" it works fine though. Odd.