IsNull

S

srctr

I have a test box in a report. I want the item to appear as follows
Dear Husband and Wife,

Here is the catch - I want to use the the Husband's Alias Name if he has
one, if not his FirstName. And if there is a spouse I want it to say "and
SpouseName", if there is no spouse it can't have the word "and"

This is what I have:
="Dear " & (IIf(IsNull([Alias]),StrConv([FirstName],3),StrConv([Alias],3)))
& " and " & StrCon([SpouseName],3) & ","

It works great if there are two names. It isn't great if I don't have a
spouse then it shows as
Dear Tom and ,

How do I do the IIf(IsNull) around the & "and" &StrConv([SpouseName],3) & ","
 
D

Duane Hookom

Try something like:
="Dear " & Nz(strConv([Alias],3),StrConv([FirstName],3)) & " and " +
StrConv([SpouseName],3) & ","
 

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