Complicated Expression

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I'm curious as to why I get the message:

"This expression is typed incorrectly, or it is too
complex to be evaluated. For example, a numeric
expression may contain too many complicated elements. Try
simplifying the expression by assigning parts of the
expression to variables. (Error 3071)"

when opening the form, but after it's opened it seems to
work fine?
 
Here's the query. (I forgot to post this last time)

SELECT

[Details].ID, [Details].Status,
([Details].Last_name & ', ' & [Details].First_name & ' '
& [Details].Middle_name) AS name,
[Details].County, [Details].Title,
[Details].Address_Mail & ' ' & [Details].suffix & IIf
([Details].U_type Is Null,'',' ' & [Details].u_type
& ' ' & [Details].unit) AS Address,
([Details].City_Mail & ', ' & [Details].state & '. ' &
[Details].Zip_Mail) AS LocatiOn,
Max(Pay.Type) AS Type, Count([Details].ID) AS cnt,
[Details].First_name, [Details].Last_name

FROM

([Details] Left Join [MAX] On [Details].ID = MAX.ID) Left
Join Pay On [Details].ID = Pay.ID

GROUP BY

[Details].ID, [Details].Status, ([Details].Last_name
& ', ' & [Details].First_name & ' ' &
[Details].Middle_name), [Details].County,
[Details].Title,
[Details].Address_Mail & ' ' & [Details].suffix & IIf
([Details].U_type Is Null,'',' ' & [Details].u_type
& ' ' & [Details].unit),
([Details].City_Mail & ', ' & [Details].state & '. ' &
[Details].Zip_Mail), [Details].First_name,
[Details].Last_name

HAVING

((([Details].First_name) Like Right(Trim([Forms]!
[Membership]![txtname]),Len(Trim([Forms]![Membership]!
[txtname]))-InStr(1,[Forms]![Membership]![txtname],","))
& '*') and
(([Details].Last_name) Like (Left([Forms]![Membership]!
[txtname],InStr(1,[Forms]![Membership]![txtname],",")-1))
& '*'))

ORDER BY

[Details].Status, ([Details].Last_name & ', ' &
[Details].First_name & ' ' & [Details].Middle_name)
 
Back
Top