Formula Problem

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.
 
A

Allen Browne

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.
 
E

Eechhutti R.Rajasekaran

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top