IIF quotes

lmcc007

Registered User.
Local time
Today, 06:18
Joined
Nov 10, 2007
Messages
635
=IIf(IsNull([ContactNickNameID]),"",[ContactNickNameID].[Column](1))

I want the name to display as "Bill" instead of just Bill.

E.g.: William "Bill" Clinton

How do I achieve that?

Thanks!
 
"""" & [ContactNickNameID].[Column](1) & """"

I think... maybe only 3 double quotes in a row, but I seem to recall it should be 4 in a row to make a single 'double-quote' (")

HTH,
John
 
type this in the immediate window in VB editor:
Code:
?"""bill"""
that might give you an idea of how to do it in your code. the result is what you're looking for
 
"""" & [ContactNickNameID].[Column](1) & """"

I think... maybe only 3 double quotes in a row, but I seem to recall it should be 4 in a row to make a single 'double-quote' (")

HTH,
John

It takes 4 quotes in a row. Works great!

Thanks!!
 
- the string you want is between the quotes:
" this is what you want "
- with only one quote on each side of [Bill] you get two strings:
" William "Bill" Clinton "
- quotes are special characters because they do more than one thing.
- to "let the computer know" you want the written character, double the character. to get William "Bill" Clinton, as in jj's example:

"""" & [ContactNickNameID].[Column](1) & """"

- another character with more than one function is '&'. in jj's example, the '&' connects the strings. what if you want the actual '&' (ampersand) character?

[correction:]
on some controls -- a command button, for example -- if you include 1 ampersand you will underline a letter (for use with the alt-key). if you want the ampersand character in the caption, you have to type 2 ampersands.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom