View Full Version : Update One Field Using Two Fields


TrekMietta
03-15-2010, 08:41 PM
Using Access 2007:

I have a table called "Staff" with three fields "firstName", "lastName" and "fullName";
and a form with three bound text boxes bound to these values:

How can i update automatically change the value of fullName to inlcude firstName and last name?

For example:
firstName = Trek
lastName = Mietta

then fullName should automatically change to: "Trek Mietta" (With a space inbetween them)

Thanks in Advance

GalaxiomAtHome
03-15-2010, 08:49 PM
You should not store the full name in a table field. To do so is a breach of normalization.
Where you need to work with the whole name you should create it as required in a query or textbox.
The Control Source of the textbox on the form:
[firstname] & " " & [lastname]

SOS
03-15-2010, 09:38 PM
As GalaxiomAtHome said, you should not be trying to store the concatenated field but instead you use a query to do so and display it to whatever you need (remember, you can use a QUERY almost wherever you can use a table).

TrekMietta
03-16-2010, 05:46 AM
Okay thanks people i will try that and see if it works!

TrekMietta
03-16-2010, 04:49 PM
OKay your probably going to shout at me here for suggesting concatenating two fields again but this would make life so much easier:

Again I have the table called "Staff" with three fields "firstName", "lastName" and "username";
and a form with three bound text boxes bound to these values:

How can i update automatically change the value of username to inlcude firstName and lastName?

For example:
firstName = Trek
lastName = Mietta

eg: username = "firstName.lastName"
(With a period "." in between them and all lowercase)

Thanks in Advance

gemma-the-husky
03-16-2010, 05:15 PM
still not!

if you need it assembling like that just say

forename & "." & lastname

TrekMietta
03-17-2010, 04:44 AM
Okay thank you for your help

SOS
03-17-2010, 07:08 AM
Again, I will state - you do NOT need to add it to the table. If you build a query which displays all fields including that concatenated one, you can use that query in place of a table where you would be using a table.