Reports and making it look prettier: Last Name, First Name Rank

K

Kimberly3626

I'm trying to pretty up my report by eliminating the forced space created by
having one field of the report for 'LastName', one for 'FirstName', and one
for 'Rank.' The Rank isn't too huge of an issue, and if three items in one
field gets to be too much, I have no problem leaving that as a side item of
sorts. But, I want my report to look a bit better by putting the names
together!

I want the report to go to my table, pull the LastName from that column, and
pair it with the matching FirstName in the column to the right. (Since it's
just looking up the personnel data, and I only have 22 personnel assigned, I
blew off a query for this particular report...it's a nice easy one)

So I found (by the magical search box) this line of code right here in the
MS forums:
=[FirstName] & " " & [LastName]

I tried it. Didn't work. And yes, the spelling is identical, and I even
paid attention to the capitol letters, just in case.

Then I tried to go in and build the string by clicking the ... button.
=[FirstName] & [LastName] (I just want it to work, I'll worry about the
space when I get the basics down)
Didn't work!

But...I'll admit that I didn't delete the original fields, just in case I
couldn't make it work right. Could this be the problem? It saw my little
line of code, along with the fields for FirstName and LastName and got mad at
me?

Please help...I found the code that works for everyone...but me! What did I
do wrong?!?!?!

PS: Access 2007
 
J

John Spencer

Didn't work? What does that mean? Did you get an error message, nothing
displayed, #Name in the control?

I suspect that you did not change the name of the control and therefore access
is confused on whether you are referring to the field LastName or the control
LastName. Try changing the control's name (properties: Other tab) to
txtFullName and then using the following as the control's source
= =[FirstName] & " " & [LastName] & ", " & [Rank]

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

Al Campagna

Kimberly3626,
First, when posting a question, "doesn't work" really doesn't tell us
anything.
Did the calculation display blank? Or #Name? Or some error?

Assuming your table/query has two fields named FirstName and LastName,
and you have 2 text controls on your report named FirstName and LastName,
and the ControlSource of each control is FirstName and LastName
respectively... and FirstName = "Bill" and LastName = "Smith"

Then... an unbound text control with a calculated (concatenated)
ControlSource of...
=[FirstName] & " " & [LastName]
would display as "Bill Smith" (without quotes).

Note: When this concatenation finally works, it's not necessary that
separate
controls... FirstName and LastName be retained on the report. The
concatenation, on it's own, will work.

Otherwise, there is some other problem besides the concatenation itself
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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