IIf issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating a report which is actually going to be an employee phone book.
It is generated from a query. The name fields are [Incumbant Last] and
[Incumbant First]. There is also a [Nickname] field for those who use
nicknames instead of their formal first name. What I want to do is if there
is a [nickname], I want that to be in place of [Incumbant First], but if
there is not then I want [Incumbant First]. Here is the current control
source:

=[Incumbent Last] & "," & [Incumbent First]

I also want it to say VACANT in place of the last and first name if
[Incumbent Last] is null.

Thanks.
 
Try:

=IIF(ISNULL([Incumbent Last]), "VACANT", [Incumbent Last] & ", " &
IIF(NOT(ISNULL(NickName)), NickName, [Incumbent First]))

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
It worked. Thank you!!!

'69 Camaro said:
Try:

=IIF(ISNULL([Incumbent Last]), "VACANT", [Incumbent Last] & ", " &
IIF(NOT(ISNULL(NickName)), NickName, [Incumbent First]))

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Kim said:
I'm creating a report which is actually going to be an employee phone book.
It is generated from a query. The name fields are [Incumbant Last] and
[Incumbant First]. There is also a [Nickname] field for those who use
nicknames instead of their formal first name. What I want to do is if there
is a [nickname], I want that to be in place of [Incumbant First], but if
there is not then I want [Incumbant First]. Here is the current control
source:

=[Incumbent Last] & "," & [Incumbent First]

I also want it to say VACANT in place of the last and first name if
[Incumbent Last] is null.

Thanks.
 
You're welcome!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


Kim said:
It worked. Thank you!!!

'69 Camaro said:
Try:

=IIF(ISNULL([Incumbent Last]), "VACANT", [Incumbent Last] & ", " &
IIF(NOT(ISNULL(NickName)), NickName, [Incumbent First]))

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember
that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


Kim said:
I'm creating a report which is actually going to be an employee phone
book.
It is generated from a query. The name fields are [Incumbant Last] and
[Incumbant First]. There is also a [Nickname] field for those who use
nicknames instead of their formal first name. What I want to do is if
there
is a [nickname], I want that to be in place of [Incumbant First], but
if
there is not then I want [Incumbant First]. Here is the current
control
source:

=[Incumbent Last] & "," & [Incumbent First]

I also want it to say VACANT in place of the last and first name if
[Incumbent Last] is null.

Thanks.
 
Back
Top