Access can perform an evaluation of data, or of an SQL statement supplied by a local object reference, but it cannot evaluate ...

Access can perform an evaluation of data, or of an SQL statement supplied by a local object reference, but it cannot evaluate data supplied by a function in Visual Basic for Applications (VBA).  If the SQL statement in the function has syntax errors, or has a reference to a variable supplied by the user at runtime and the user provides an invalid response, this error message may appear.