Trimming first and last name fields

sstasiak

Registered User.
Local time
Today, 02:37
Joined
Feb 8, 2007
Messages
97
I'm creating a report in my DB and for the name, I'd like to have the format be "LNAME, FNAME". The problem is that in the table, I have LNAME and FNAME as 2 seperate fields.

How can I create a report that will give the last name, comma/space, and first name so that it trims the text box down to the length of the text?

I hope that makes sense.
 
Create a query based on your table. In the Field row give your new field a name, lets say FullName followed by a colon :. Then we type in the expression for our new field which would be: [LName] & ", " & [FName]. So all in all we should have put for the field row in our query:

FullName: [LName] & ", " & [FName]

This new field will have the name FullName when referenced by a report and will display the value in the format "LName, FName".

That should do it for you.
 
Kernel

Is that line the only thing that needs to be entered in the querys field row?

I put that in, then set the control source of the text box in the report to the query which sets it to "=[FullName]![FULLNAME]"

That doesn't seem to be working.
 
You can just add an unboundtextbox to the Report and set its control source to = [LName] & ", " & [FName]
 
Where is the rest of the report data coming from? The same table that the query we just created uses? If so, modify the query so that it contains our custom field as well as all of the other fields that you need for the report. Then base the ENTIRE report on the query, and assign the one text box to our custom field.
 
I figured it out guys. Richs' original didn't work, but I modified it and it works. The control source is now set to:

=[Forms]![OncRegMain]![LNAME] & ", " & [Forms]![OncRegMain]![FNAME]

Thanks for the help. Now I've got another thread in the "Reports" forum that maybe you guys could help me with.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom