using iif() in text box to display alternative data fails?

H

Howard

I've a report based on a query that amongst other things gives me a maths
grade in one field with possible values A, B, C or maybe blank if no grade
was entered

I group the report by that field.

In the group header I have a text box. Setting the control source of the
text box to [Maths grade] works OK but setting it to
iif([Maths Grade] <> "",[Maths Grade],"No grade entered') always displays
the letter D.

I don't know what is going on as there is not even a grade D in the
underlying query.

Any ideas?
Howard
 
D

Douglas J. Steele

Odds are that your [Maths Grade] field contains Null, not a zero-length
string.

IIf(Len([Maths Grade] & "") > 0,[Maths Grade],"No grade entered')

or

Nz([Maths Grade], "No grade entered")
 

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