Formula Problem

  • Thread starter Thread starter Carol Consolo
  • Start date Start date
C

Carol Consolo

Given the following expression attached to a control named Surviving Spouse,
does anyone know why I would continually receive a message saying "Syntax
error (comma) in query expression" every time I attempt to run the report?
Everything is spelled correctly, etc. and it does exactly what I need it to
do (on paper).

IIf([MaritalStatus]="Widowed","",IIf([Sex]="Male" And
[MaritalStatus]="Married",[Wife's Maiden Name],IIf([Sex]="Female" And
[MaritalStatus]="Married",[KINFIRST] & " " & [KINLAST],"Not Applicable")))

Help would REALLY be appreciated.

Thanks.
 
Did you remember the equal sign at the start of the expression?

Also, check that the Name of this control is not the same as the name of any
field.
 
Perhaps you have created the function in the control box in the report, in
which case you should have used the sign =
Apparently you have omitted this. Otherwise the expression is correct.
You can alternatively create an expression in your query with the same
syntax, i.e.,
surviving spouse:IIf([MaritalStatus]="Widowed","",IIf([Sex]="Male" And
[MaritalStatus]="Married",[Wife's Maiden Name],IIf([Sex]="Female" And
[MaritalStatus]="Married",[KINFIRST] & " " & [KINLAST],"Not Applicable")))
From the query, you can create the report. The syntax you have used is
correct.

Eechhutti R.Rajasekaran
(e-mail address removed)
 
Back
Top