Lookup Criteria

Lookup Criteria

On a form I have a lookup to another table. I want to omit records where a string field is longer than 5 characters. When I add this code to the criteria section of the lookup field
Str_Field.length()  > 5

I get this error

Either the left or the right expression in a boolean expression in the criteria has to be a Form/Table Variable

What steps do I need to omit these records?

Herb Wexler