Adding data from two columns of a form into one

Warrl

New member
Local time
Today, 00:20
Joined
Mar 7, 2012
Messages
5
I'm new to Access and I have a Users table which includes the following columns "First Name" & "Last Name". I would like to create a new column ("Full Name") in the same Users table that would automatically add the first name and last name into one field and would show up like the following: Last Name, First Name.

Suggestions?

Thanks!:)
 
FullName:[LastName] & " " & [FirstName]

PS Kill the spaces. Not a good naming convention.
 
Forgot to mention.

For Access 2003 do this in a Query not a Table.

For 2007 and 2010 I am not sure about the Table but will work in a Query
 
Thanks. Unfortunately the fields are already conected to other forms. I'm afraid if I change to field name to FirstName the other forms will stop working. Also, I tried creating the Field FullName and I then opened up the design view and stated the Data Type was Text and in the Field Properties below under default Value I pasted the code you suggested. I got the following error messge:

"the database engine does not recognize either the field 'First Name' in a validation expression, or the default value in the table 'tbl_Users'.

any suggestions?

Thanks,
Warrl
 
Is this just for display purposes? That is, you're not going to be entering or editing data in this box?

If so, then you want an unbound text box.

From the Toolbox toolbar, create a text box, open Properties (right-click, "Properties") and in the Data tab select Control Source

Type in:

Code:
=[LastName] & " " & [FirstName]

PS - RainLover is right about how you're naming the fields.
 
Last edited:
Except for the spaces my Code is correct for a Query.

The Second suggestion for a Form should also work.

Where are you trying to put this Code.?

As far as spaces are concerned, do a back up and then try deleting them. The change might carry through. At least give it a try. If it doesn't work then read up on "Naming Conventions" but still change things NOW before you continue.

Also suggest you post your Windows and Access Versions as part of your Signature. Things changed a lot in 2007.
 
Thanks! Everything worked out fine. I was able to get the names to work properly.
 
I have basically the same need EXCEPT, I want the FULLNAME field to be part of the record. Can this be done?
 
The full name should not be stored in the record since it can easily be built in a query. Forms and Reports should not be bound to tables anyway and so there should be no problem. If you want to export a file that includes the FullName, just export the query rather than the table.

Select fld1, fld2, fld3, ..., [First Name] & " " & [Last Name] As FullName
From YourTable;
 
Thanks Pat. I was over thinking what I was trying to accomplish.
 

Users who are viewing this thread

Back
Top Bottom