Concatenating two fields in a form to create a third field

A

Amit

Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".

Any help will be appreciated. Thanks!

-Amit
 
M

Mike Painter

Amit said:
Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".

There is no need for this third field.
You can put =Me![FName] & " " & Me![LName] in an unbound text box on your
form

Most of the time it is best to place FullName:[FName] & " " & [LName]
in a query, then use FullName in all reports and forms.

If you don't do this and miss a form or somebody modifies a table entry then
Sue Smith who changed sex and got married will still show as Bob Jones in
some places and not others.
 
A

Amit

Hi Mike.

I tried what you suggested, and am still getting the same
error - #Name? .

I even tried this in a new form. Is there anything else I
could be doing wrong??

-Amit
-----Original Message-----

Amit said:
Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".

There is no need for this third field.
You can put =Me![FName] & " " & Me![LName] in an unbound text box on your
form

Most of the time it is best to place FullName:[FName] & " " & [LName]
in a query, then use FullName in all reports and forms.

If you don't do this and miss a form or somebody modifies a table entry then
Sue Smith who changed sex and got married will still show as Bob Jones in
some places and not others.


.
 
A

Amit

Hi Mike:

I finally got it. When I created a form and had an unbound
textbox with {=Me![FName] & " " & Me![LName]} in Control
Source, I still got the #Name? error.

But, when I create a query with another field which
concatenates FName and LName, and then base the form on
this query, it works fine!!

Maybe there's no way to accomplish this without a query
inbetween the table and form...??

Thanks again for your suggestions.

-Amit
-----Original Message-----

Amit said:
Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".

There is no need for this third field.
You can put =Me![FName] & " " & Me![LName] in an unbound text box on your
form

Most of the time it is best to place FullName:[FName] & " " & [LName]
in a query, then use FullName in all reports and forms.

If you don't do this and miss a form or somebody modifies a table entry then
Sue Smith who changed sex and got married will still show as Bob Jones in
some places and not others.


.
 
M

Mike Painter

Amit said:
Hi Mike:

I finally got it. When I created a form and had an unbound
textbox with {=Me![FName] & " " & Me![LName]} in Control
Source, I still got the #Name? error.

But, when I create a query with another field which
concatenates FName and LName, and then base the form on
this query, it works fine!!

Maybe there's no way to accomplish this without a query
inbetween the table and form...??

The query is the better way.
 
A

Amit

-----Original Message-----
If you did this on a form the most likely thing (when I do it) is that the
name of the textbox is also the name of one of the fields.

I actually did check for this before reading your post,
and the name of the unbound textbox (fullname) in the form
is totally different from the names of the other fields
(FName and LName). So, I'm not sure why it didn't work....

But, as you can read from my earlier post, it did work
when I used a query inbetween the table and form.

Thanks again for your help, Mike.

-AV
Amit said:
Hi Mike.

I tried what you suggested, and am still getting the same
error - #Name? .

I even tried this in a new form. Is there anything else I
could be doing wrong??

-Amit
-----Original Message-----

Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".


There is no need for this third field.
You can put =Me![FName] & " " & Me![LName] in an
unbound
text box on your
form

Most of the time it is best to place FullName:[FName] & " " & [LName]
in a query, then use FullName in all reports and forms.

If you don't do this and miss a form or somebody
modifies
a table entry then
Sue Smith who changed sex and got married will still
show
as Bob Jones in
some places and not others.


.


.
 
A

Albert D. Kallal

The unbound text box of:

=([Fname] & " " & [LName])

should work.

You need a set of brackts around the whole expression.


Amit said:
Hi Mike:

I finally got it. When I created a form and had an unbound
textbox with {=Me![FName] & " " & Me![LName]} in Control
Source, I still got the #Name? error.

But, when I create a query with another field which
concatenates FName and LName, and then base the form on
this query, it works fine!!

Maybe there's no way to accomplish this without a query
inbetween the table and form...??

Thanks again for your suggestions.

-Amit
-----Original Message-----

Amit said:
Hi,

I have a table with the following fields:
-ID
-Fname (first name)
-Lname (last name)
-Name (first and last name)
In the form, I have the following expression for Name:
=[Table1]![FName] & " " & [Table1]![LName]

It is not working, and I'm not sure what I'm doing wrong.
I get the following text in the textbox
for "Name": "#Name?".

There is no need for this third field.
You can put =Me![FName] & " " & Me![LName] in an unbound text box on your
form

Most of the time it is best to place FullName:[FName] & " " & [LName]
in a query, then use FullName in all reports and forms.

If you don't do this and miss a form or somebody modifies a table entry then
Sue Smith who changed sex and got married will still show as Bob Jones in
some places and not others.


.
 

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

Similar Threads


Top