Access 2007 – reports and sub reports

Got this error when trying to place a sub report in a main report “Error: the expression is typed incorrectly or it is too complex to be evaluated” This only occurred when trying to create a sub report, sub report works on its own fine but when launched within the main report the above error pops up multiple times.

Identified by a process of elimination that there was a field in the table on which the sub report was based which had the same name as a field in the table on which the main report was based.

Further this common field name was being used as the key field to create the parent child relationship; the error is thus probably due to a naming conflict.

The solution is to rename the conflicting field in the sub report, by editing the SQL statement for the sub report and replacing the conflicting field name with table.conflictname as newnonconflcitingname

e.g. select field1, field2, field3 as myfield3, field4 from table (Note in this example field3 is the conflicting field)

%d bloggers like this: