Move fields if missing data?

  • Thread starter Thread starter Crispy
  • Start date Start date
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!
 
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]))
 
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!
 
Back
Top