Move fields if missing data?

C

Crispy

Hi,

Quick question... I have a student record database. Trying to generate a
report that will produce a Family Directory.

The standard format of the report at the moment is:

Childs Name
Father & Mother's Name
Address
Phone
Email

My problem comes if one of the parents names are not there... (aka widow,
single, etc.)

Then it comes out looking like:

Childs Name
& Mother's Name
Address
Phone
Email

Right now the mother and father's name are concatenated together with an "&"
symbol between them... however if one or the other is missing... I'm left
with a "&" symbol and then one name.

Any suggestions? I"m a novice so I apologize.

Thanks!
 
J

Jeff Boyce

Crispy

Take a look at the IIF() and Nz() functions in Access HELP. One
possibility, off the top, is something like (actual syntax may vary):

IIF(Nz([FathersName],"")="",[MothersName],[FathersName] &
IIF(Nz([MothersName],"")="","", " & " & [MothersName]))
 
C

Crispy

I read up, and sorta understood it--- but not nearly enough to write the
code. Luckly, however, your code worked like a charm.

Thank you!
 

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