combing Last and First name

R

rupe

I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
M

M Skabialka

Make sure you don't use either of the field names listed as the name of you
new control - call it Full_Name or something.
Mich
 
J

Jeff Boyce

When Access says "#Name" it means it can't find something spelled the way
you spelled it. Spelling counts.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages

What are the actual field names in your table? It would seem that they are
something OTHER than [Last_Name] and [First_Name] - perhaps the actual field
is called [Last Name], with a blank?

Or might the fields in your table be Lookup fields? If so, they contain a
number, not the actual name.
 
K

Klatuu

As already stated, you likely have a spelling problem, but be aware the
control will present the name, but you will not be able to update it because
it has to be one field to one control to be able to update it.
 
R

Richard

Rupe,

Have you tried a new unbound textbox on your form with:
=[Last_Name] & " " & [First_Name]

Richard
rupe said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
R

rupe

Yes and unfortunately the samething again

Richard said:
Rupe,

Have you tried a new unbound textbox on your form with:
=[Last_Name] & " " & [First_Name]

Richard
rupe said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
R

rupe

I have checked the spelling over and over, but what do you mean by "it has to
be one field to one control" as i have only one Customer_ID to the linked
Names fields?

Thank you

Klatuu said:
As already stated, you likely have a spelling problem, but be aware the
control will present the name, but you will not be able to update it because
it has to be one field to one control to be able to update it.
--
Dave Hargis, Microsoft Access MVP


rupe said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
J

Jeanette Cunningham

Are Last_Name and First_Name in the query that is the record source of the
form?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



rupe said:
Yes and unfortunately the samething again

Richard said:
Rupe,

Have you tried a new unbound textbox on your form with:
=[Last_Name] & " " & [First_Name]

Richard
:

I trying to combine First and Last names into a form, however I just
get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral
source
however it just does not work?

Please help i have been trying to do this for ages
 
R

rupe

The field names are [Last_Name] and [First_Name], no the last point i have
only text in the fields [Last_Name] and [First_Name] they are not numbers

thank you for your help

John W. Vinson said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages

What are the actual field names in your table? It would seem that they are
something OTHER than [Last_Name] and [First_Name] - perhaps the actual field
is called [Last Name], with a blank?

Or might the fields in your table be Lookup fields? If so, they contain a
number, not the actual name.
 
R

rupe

Tried this too it is called Customer Contact in the form

thank you for your help

M Skabialka said:
Make sure you don't use either of the field names listed as the name of you
new control - call it Full_Name or something.
Mich

rupe said:
I trying to combine First and Last names into a form, however I just get
the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
R

rupe

I have Customer_ID in the table relating to the form and in my Customer_ID is
the primary key in the Customer_Contact table which I have the First_Name and
Last_Name field hope that sounds right?

Thank you

Jeanette Cunningham said:
Are Last_Name and First_Name in the query that is the record source of the
form?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



rupe said:
Yes and unfortunately the samething again

Richard said:
Rupe,

Have you tried a new unbound textbox on your form with:
=[Last_Name] & " " & [First_Name]

Richard


:

I trying to combine First and Last names into a form, however I just
get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral
source
however it just does not work?

Please help i have been trying to do this for ages
 
K

Klatuu

It has nothing to do with the relationship of the data. I would hope you
have only one name associated with a customer id.

The issue is being able to save the data to the table. One form control
cannot be used by two fields in the form's recordset and be updatable.
--
Dave Hargis, Microsoft Access MVP


rupe said:
I have checked the spelling over and over, but what do you mean by "it has to
be one field to one control" as i have only one Customer_ID to the linked
Names fields?

Thank you

Klatuu said:
As already stated, you likely have a spelling problem, but be aware the
control will present the name, but you will not be able to update it because
it has to be one field to one control to be able to update it.
--
Dave Hargis, Microsoft Access MVP


rupe said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 
J

John W. Vinson

What is the Recordsource of your form? If it's a query, please post the SQL
view; if it's a table please post the relevant fieldnames.

What's the context? What is the name of the control that you're setting its
control source?
The field names are [Last_Name] and [First_Name], no the last point i have
only text in the fields [Last_Name] and [First_Name] they are not numbers

thank you for your help

John W. Vinson said:
I trying to combine First and Last names into a form, however I just get the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages

What are the actual field names in your table? It would seem that they are
something OTHER than [Last_Name] and [First_Name] - perhaps the actual field
is called [Last Name], with a blank?

Or might the fields in your table be Lookup fields? If so, they contain a
number, not the actual name.
 
J

John W. Vinson

I have Customer_ID in the table relating to the form and in my Customer_ID is
the primary key in the Customer_Contact table which I have the First_Name and
Last_Name field hope that sounds right?

So First_Name and Last_Name are *NOT* fields in this form's table? If so, they
are not available for an expression. You can only concatenate fields that...
ummm... exist in that form's table.

One possibility would be to have a Combo Box bound to the Customer_ID field,
based on a query like

SELECT Customer_ID, [First_Name] & " " & [Last_Name] FROM Customers ORDER BY
Last_Name, First_Name;

to display the name while storing the ID.
 
J

Jeanette Cunningham

Hi rupe,
the reason that you are seeing #Name is because both Last_Name and
First_Name are in the related table.

If you had a form based on the Customer contact table, then you could use
=[Last_Name] & " " & [First_Name]
and it would work.

Some options for you are
1. Use a combo box as described by John Vinson
2. Change the recordsource of your form by adding the Customer contact table
to the recordsource (the query for the form) and include only the last name
and first name fields from that table.
3. Create a query based on the customer contact table.
Include the primary key and in the next blank column type
FullName: [Last_Name] & " " & [First_Name]

Save the query as qryCustomerFullName

Back on your form you can use a DLookup.
On the Current event of your form put code like this untested air code-->
Me.NameOfTextbox = Nz(DLookup("[FullName]", "qryCustomerFullName",
"[Customer_ID] = " & Me.Customer_ID),"")


Note: replace NameOfTextbox with the real name of the textbox that will show
the customer's name.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



rupe said:
Tried this too it is called Customer Contact in the form

thank you for your help

M Skabialka said:
Make sure you don't use either of the field names listed as the name of
you
new control - call it Full_Name or something.
Mich

rupe said:
I trying to combine First and Last names into a form, however I just get
the
#Name?
I have typed =[Last_Name] & " " & [First_Name] in to the contral source
however it just does not work?

Please help i have been trying to do this for ages
 

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

Top