Remove space

  • Thread starter Thread starter mabyn
  • Start date Start date
M

mabyn

I have a First Name and a Last Name on a report. How do I make these appear
as one name when they print out without funny looking space. Thank you.
 
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on the
report try =[FirstName]&" "&[LastName] in the Control Source property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
If you use:

=[FirstName]&", "&[LastName] <---adding a comma between the quotation marks

If will show as:

Smith, Bill

Rather than:

Smith Bill <---no comma



Gina Whipp wrote:

Mabyn,I'm not sure what a 'funny looking space' is but in one text field on
04-Feb-09

Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on the
report try =[FirstName]&" "&[LastName] in the Control Source property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


Previous Posts In This Thread:

Remove space
I have a First Name and a Last Name on a report. How do I make these appear
as one name when they print out without funny looking space. Thank you.
--
Mabyn

Mabyn,I'm not sure what a 'funny looking space' is but in one text field on
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on the
report try =[FirstName]&" "&[LastName] in the Control Source property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


EggHeadCafe - Software Developer Portal of Choice
Painting the Canvas with Silverlight 2.0
http://www.eggheadcafe.com/tutorial...4e-619dac0b86b8/painting-the-canvas-with.aspx
 
To add to your observation, Michael, you may like to try:
=[LastName] & ", " + [FirstName]

This generates:
a) Smith, Bill if both names exist
b) Smith if only a last name exists
c) , Bill if only a first name exists.
d) if neither name exists.

(a) is typical.
(b) is useful if you use the LastName for company names too.
(c) is informative if the surname is unknown.
(d) is a null, so there's no junk and it can shrink on a report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in message news:[email protected]...
 
Close, but what you want is

=(LastName + ", ") & FirstName

OR

=(LastName & ( ", " + FirstName)

The first will generate a comma when the LastName is not null
The second will generate a comma when the FirstName is not null

If you want the comma only when both are present
= LastName & IIF(LastName is Null and FirstName is Null,"",", ") & FirstName



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
=[LastName] + ( ", " & [FirstName])

Will generate:
Bill
with no comma in front.

Steve
(e-mail address removed)


Allen Browne said:
To add to your observation, Michael, you may like to try:
=[LastName] & ", " + [FirstName]

This generates:
a) Smith, Bill if both names exist
b) Smith if only a last name exists
c) , Bill if only a first name exists.
d) if neither name exists.

(a) is typical.
(b) is useful if you use the LastName for company names too.
(c) is informative if the surname is unknown.
(d) is a null, so there's no junk and it can shrink on a report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


If you use:

=[FirstName]&", "&[LastName] <---adding a comma between the quotation
marks

If will show as:

Smith, Bill

Rather than:

Smith Bill <---no comma



Gina Whipp wrote:

Mabyn,I'm not sure what a 'funny looking space' is but in one text field
on
04-Feb-09

Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on the
report try =[FirstName]&" "&[LastName] in the Control Source property
of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


Previous Posts In This Thread:

Remove space
I have a First Name and a Last Name on a report. How do I make these
appear
as one name when they print out without funny looking space. Thank you.
--
Mabyn

Mabyn,I'm not sure what a 'funny looking space' is but in one text field
on
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on the
report try =[FirstName]&" "&[LastName] in the Control Source property
of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


EggHeadCafe - Software Developer Portal of Choice
Painting the Canvas with Silverlight 2.0
http://www.eggheadcafe.com/tutorial...4e-619dac0b86b8/painting-the-canvas-with.aspx
 
Unlike your response when you find an error!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Steve said:
John,

Thanks for being polite about my error!

Isn't Allen's response b) also incorrect? Wouldn't ypu get ,Smith?

Steve


John Spencer said:
Close, but what you want is

=(LastName + ", ") & FirstName

OR

=(LastName & ( ", " + FirstName)

The first will generate a comma when the LastName is not null
The second will generate a comma when the FirstName is not null

If you want the comma only when both are present
= LastName & IIF(LastName is Null and FirstName is Null,"",", ") &
FirstName



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
=[LastName] + ( ", " & [FirstName])

Will generate:
Bill
with no comma in front.

Steve
(e-mail address removed)


To add to your observation, Michael, you may like to try:
=[LastName] & ", " + [FirstName]

This generates:
a) Smith, Bill if both names exist
b) Smith if only a last name exists
c) , Bill if only a first name exists.
d) if neither name exists.

(a) is typical.
(b) is useful if you use the LastName for company names too.
(c) is informative if the surname is unknown.
(d) is a null, so there's no junk and it can shrink on a report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in message
If you use:

=[FirstName]&", "&[LastName] <---adding a comma between the quotation
marks

If will show as:

Smith, Bill

Rather than:

Smith Bill <---no comma



Gina Whipp wrote:

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
04-Feb-09

Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source
property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


Previous Posts In This Thread:

Remove space
I have a First Name and a Last Name on a report. How do I make these
appear
as one name when they print out without funny looking space. Thank
you.
--
Mabyn

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source
property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


EggHeadCafe - Software Developer Portal of Choice
Painting the Canvas with Silverlight 2.0
http://www.eggheadcafe.com/tutorial...4e-619dac0b86b8/painting-the-canvas-with.aspx
 
No, the precedence of the operators would eliminate the comma. I don't like
to rely on operator precedence and prefer forcing the precedence with parentheses.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
John,

Thanks for being polite about my error!

Isn't Allen's response b) also incorrect? Wouldn't ypu get ,Smith?

Steve


John Spencer said:
Close, but what you want is

=(LastName + ", ") & FirstName

OR

=(LastName & ( ", " + FirstName)

The first will generate a comma when the LastName is not null
The second will generate a comma when the FirstName is not null

If you want the comma only when both are present
= LastName & IIF(LastName is Null and FirstName is Null,"",", ") &
FirstName



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
=[LastName] + ( ", " & [FirstName])

Will generate:
Bill
with no comma in front.

Steve
(e-mail address removed)


To add to your observation, Michael, you may like to try:
=[LastName] & ", " + [FirstName]

This generates:
a) Smith, Bill if both names exist
b) Smith if only a last name exists
c) , Bill if only a first name exists.
d) if neither name exists.

(a) is typical.
(b) is useful if you use the LastName for company names too.
(c) is informative if the surname is unknown.
(d) is a null, so there's no junk and it can shrink on a report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in message
If you use:

=[FirstName]&", "&[LastName] <---adding a comma between the quotation
marks

If will show as:

Smith, Bill

Rather than:

Smith Bill <---no comma



Gina Whipp wrote:

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
04-Feb-09

Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source property
of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


Previous Posts In This Thread:

Remove space
I have a First Name and a Last Name on a report. How do I make these
appear
as one name when they print out without funny looking space. Thank you.
--
Mabyn

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source property
of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


EggHeadCafe - Software Developer Portal of Choice
Painting the Canvas with Silverlight 2.0
http://www.eggheadcafe.com/tutorial...4e-619dac0b86b8/painting-the-canvas-with.aspx
 
Steve, try it in the Immediate window.

Assuming that Surname is null, the equivalent of (b) would be:
? "Smith" & ", " + Null
and of (c) would be:
? Null & ", " & "Bill"

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Steve said:
John,

Thanks for being polite about my error!

Isn't Allen's response b) also incorrect? Wouldn't ypu get ,Smith?

Steve


John Spencer said:
Close, but what you want is

=(LastName + ", ") & FirstName

OR

=(LastName & ( ", " + FirstName)

The first will generate a comma when the LastName is not null
The second will generate a comma when the FirstName is not null

If you want the comma only when both are present
= LastName & IIF(LastName is Null and FirstName is Null,"",", ") &
FirstName



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
=[LastName] + ( ", " & [FirstName])

Will generate:
Bill
with no comma in front.

Steve
(e-mail address removed)


To add to your observation, Michael, you may like to try:
=[LastName] & ", " + [FirstName]

This generates:
a) Smith, Bill if both names exist
b) Smith if only a last name exists
c) , Bill if only a first name exists.
d) if neither name exists.

(a) is typical.
(b) is useful if you use the LastName for company names too.
(c) is informative if the surname is unknown.
(d) is a null, so there's no junk and it can shrink on a report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in message
If you use:

=[FirstName]&", "&[LastName] <---adding a comma between the quotation
marks

If will show as:

Smith, Bill

Rather than:

Smith Bill <---no comma



Gina Whipp wrote:

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
04-Feb-09

Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source
property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


Previous Posts In This Thread:

Remove space
I have a First Name and a Last Name on a report. How do I make these
appear
as one name when they print out without funny looking space. Thank
you.
--
Mabyn

Mabyn,I'm not sure what a 'funny looking space' is but in one text
field on
Mabyn,

I'm not sure what a 'funny looking space' is but in one text field on
the
report try =[FirstName]&" "&[LastName] in the Control Source
property of
the text field.

Name the field txtFullName

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm


EggHeadCafe - Software Developer Portal of Choice
Painting the Canvas with Silverlight 2.0
http://www.eggheadcafe.com/tutorial...4e-619dac0b86b8/painting-the-canvas-with.aspx
 
Back
Top