Save concatonated record on form? (1 Viewer)

spoole

Registered User.
Local time
Today, 11:47
Joined
Oct 23, 2007
Messages
81
I have a form based on a table. Upon saving the newly added records I also want to concatonate two fields on the form and add them to the table into an existing column "Fullname"

The two boxes to be concatonated on the form are "Name" and "Lastname" (both bound)

I then draged the "Fullname" onto the form from the feild list and changed its control sourcew to be =Form!Name & [Surname]

This works so much as in it displys the correct info in the field when the two bound boxes are filled in but does not save that record to the table?


Where am I going wrong?
 

vbaInet

AWF VIP
Local time
Today, 19:47
Joined
Jan 22, 2010
Messages
26,374
You don't save calculated fields. Anytime you want to have a FullName field, simply concatenate it, it's really not a big job.

Here are reasons why you should not save calculated fields:

http://allenbrowne.com/casu-14.html
 

spoole

Registered User.
Local time
Today, 11:47
Joined
Oct 23, 2007
Messages
81
You don't save calculated fields. Anytime you want to have a FullName field, simply concatenate it, it's really not a big job.

Here are reasons why you should not save calculated fields:

http://allenbrowne.com/casu-14.html

Of course you are right, and I have read that you dont save calculated feilds. The only reason I am doing this is I have created another form that is searchable by the full name.

I guess I should make the search form searched by both Name and Surname together?
 

vbaInet

AWF VIP
Local time
Today, 19:47
Joined
Jan 22, 2010
Messages
26,374
Create a query and Concatenate inside the query. Use this query as the Record Source of your form. You can then search on that field.
 

spoole

Registered User.
Local time
Today, 11:47
Joined
Oct 23, 2007
Messages
81
Create a query and Concatenate inside the query. Use this query as the Record Source of your form. You can then search on that field.

Doh!

Simple when you know how and a good example of the thoery that there are many ways to skin a cat in Access.

thanks vbaInet
 

ansentry

Access amateur
Local time
Tomorrow, 04:47
Joined
Jun 1, 2003
Messages
995
First base your form on a query (use query as record source)
In a new column in the query enter this:
FullName:FName &" "& LastName This will return John Smith

I have changed "Name" to FName (for first Name) , you should not use the word Name as it is a reserved word in MS Access.

Hope this explains it.
 

spoole

Registered User.
Local time
Today, 11:47
Joined
Oct 23, 2007
Messages
81
Thanks vbaInet and ansentry works like a charm!
 

ansentry

Access amateur
Local time
Tomorrow, 04:47
Joined
Jun 1, 2003
Messages
995
Did you change Name to FName?

Better to do it now than have trouble at the end of your project. Have a read here
 

spoole

Registered User.
Local time
Today, 11:47
Joined
Oct 23, 2007
Messages
81
Hi ansenrty yes I did, to be honest I didnt know it was one of the reserved access names.

edit*

My goodness have they left any names to use :eek:
 

Users who are viewing this thread

Top Bottom