How do combine first and last name fields into another seperate fi

D

Dustin

I need to combined certain customers first and last name into one field. Can
I write a query to do this? And only to the ones that need it?
 
K

KARL DEWEY

I need to combined certain customers first and last name into one field.
Full Name: [FirstNameField] & " " &[LastNameField]
OR
Name: [LastNameField] & ", " &[FirstNameField]
You need to figure out the criteria for this.
 
R

Rick B

You can do this in your queries, reports, and forms, but you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]
 
D

Dustin

I am using a form, and I have a text box called Business Name to put in the
name of the customers business if he doesn't give his name. (Ex. Bollig Farms
Inc.) So I want to combine first and last in business name for those that
just gave their name. And use business name as the field I would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave their names with
out bothering the ones that gave the business name with the formula you gave
me?

Thanks,
Dustin

Rick B said:
You can do this in your queries, reports, and forms, but you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



Dustin said:
I need to combined certain customers first and last name into one field.
Can
I write a query to do this? And only to the ones that need it?
 
K

KARL DEWEY

Do you have three fields - Last, First, Business?

If three then use this as source fir the text box called Business Name ---
=IIF([Business] Is Null, [FirstName] & " " & [LastName], [Business])

--
KARL DEWEY
Build a little - Test a little


Dustin said:
I am using a form, and I have a text box called Business Name to put in the
name of the customers business if he doesn't give his name. (Ex. Bollig Farms
Inc.) So I want to combine first and last in business name for those that
just gave their name. And use business name as the field I would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave their names with
out bothering the ones that gave the business name with the formula you gave
me?

Thanks,
Dustin

Rick B said:
You can do this in your queries, reports, and forms, but you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



Dustin said:
I need to combined certain customers first and last name into one field.
Can
I write a query to do this? And only to the ones that need it?
 
D

Dustin

I got error in the Business Name text box when I entered the formula you
gave me into the Business Name text box in Design View. Am I doing something
wrong?

I am going home for the night. I would really appreciate if you would keep
with me I will be back tommorrow.

Thanks for all your help.

Dustin

KARL DEWEY said:
Do you have three fields - Last, First, Business?

If three then use this as source fir the text box called Business Name ---
=IIF([Business] Is Null, [FirstName] & " " & [LastName], [Business])

--
KARL DEWEY
Build a little - Test a little


Dustin said:
I am using a form, and I have a text box called Business Name to put in the
name of the customers business if he doesn't give his name. (Ex. Bollig Farms
Inc.) So I want to combine first and last in business name for those that
just gave their name. And use business name as the field I would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave their names with
out bothering the ones that gave the business name with the formula you gave
me?

Thanks,
Dustin

Rick B said:
You can do this in your queries, reports, and forms, but you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



I need to combined certain customers first and last name into one field.
Can
I write a query to do this? And only to the ones that need it?
 
K

KARL DEWEY

I did not test first -- put it in your query that is the source for the form.
--
KARL DEWEY
Build a little - Test a little


Dustin said:
I got error in the Business Name text box when I entered the formula you
gave me into the Business Name text box in Design View. Am I doing something
wrong?

I am going home for the night. I would really appreciate if you would keep
with me I will be back tommorrow.

Thanks for all your help.

Dustin

KARL DEWEY said:
Do you have three fields - Last, First, Business?

If three then use this as source fir the text box called Business Name ---
=IIF([Business] Is Null, [FirstName] & " " & [LastName], [Business])

--
KARL DEWEY
Build a little - Test a little


Dustin said:
I am using a form, and I have a text box called Business Name to put in the
name of the customers business if he doesn't give his name. (Ex. Bollig Farms
Inc.) So I want to combine first and last in business name for those that
just gave their name. And use business name as the field I would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave their names with
out bothering the ones that gave the business name with the formula you gave
me?

Thanks,
Dustin

:

You can do this in your queries, reports, and forms, but you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



I need to combined certain customers first and last name into one field.
Can
I write a query to do this? And only to the ones that need it?
 
J

Joe Marchione

Dustin,

Not sure what error you are getting. I assume you have "#ERROR"
in the control.

Be sure the name of the control is not the same as a field name
for the form.


HTH,

Joe





Dustin said:
I got error in the Business Name text box when I entered the
formula you
gave me into the Business Name text box in Design View. Am I
doing something
wrong?

I am going home for the night. I would really appreciate if you
would keep
with me I will be back tommorrow.

Thanks for all your help.

Dustin

KARL DEWEY said:
Do you have three fields - Last, First, Business?

If three then use this as source fir the text box called
Business Name ---
=IIF([Business] Is Null, [FirstName] & " " & [LastName],
[Business])

--
KARL DEWEY
Build a little - Test a little


Dustin said:
I am using a form, and I have a text box called Business
Name to put in the
name of the customers business if he doesn't give his name.
(Ex. Bollig Farms
Inc.) So I want to combine first and last in business name
for those that
just gave their name. And use business name as the field I
would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave
their names with
out bothering the ones that gave the business name with the
formula you gave
me?

Thanks,
Dustin

:

You can do this in your queries, reports, and forms, but
you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the
following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box
and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



message
I need to combined certain customers first and last name
into one field.
Can
I write a query to do this? And only to the ones that
need it?
 
D

Dustin

That worked but only on the form, it didn't put it in the table so that I can
merge the names and addresses in word.

What do I do now?

Thanks
Dustin

Joe Marchione said:
Dustin,

Not sure what error you are getting. I assume you have "#ERROR"
in the control.

Be sure the name of the control is not the same as a field name
for the form.


HTH,

Joe





Dustin said:
I got error in the Business Name text box when I entered the
formula you
gave me into the Business Name text box in Design View. Am I
doing something
wrong?

I am going home for the night. I would really appreciate if you
would keep
with me I will be back tommorrow.

Thanks for all your help.

Dustin

KARL DEWEY said:
Do you have three fields - Last, First, Business?

If three then use this as source fir the text box called
Business Name ---
=IIF([Business] Is Null, [FirstName] & " " & [LastName],
[Business])

--
KARL DEWEY
Build a little - Test a little


:

I am using a form, and I have a text box called Business
Name to put in the
name of the customers business if he doesn't give his name.
(Ex. Bollig Farms
Inc.) So I want to combine first and last in business name
for those that
just gave their name. And use business name as the field I
would use on the
envelopes for mailings.

So is it possible to just combine the ones that just gave
their names with
out bothering the ones that gave the business name with the
formula you gave
me?

Thanks,
Dustin

:

You can do this in your queries, reports, and forms, but
you DON'T want to
store the results in your tables.

To so in a query, create a new column and put the
following in it:
FullName: [FirstName] & " " & [LastName]


To do so in a form or a report, add an unbound text box
and put the
following in it:
=[FirstName] & " " & [Last Name]



Or, you might want...
[LastName] & ", " & [FirstName]


--
Rick B



message
I need to combined certain customers first and last name
into one field.
Can
I write a query to do this? And only to the ones that
need it?
 
P

pauld

Karl,

I noticed this thread and I'd like to ask your advice on the opposite
challenge.

The names in my NAME field are "John Smith" and "Frank Jones", etc

I need to create a report that will show the names sorted by last name, ie,
Jones, Frank...and Smith, John.

How would I do that?

Thanks.

KARL DEWEY said:
Full Name: [FirstNameField] & " " &[LastNameField]
OR
Name: [LastNameField] & ", " &[FirstNameField]
You need to figure out the criteria for this.
--
KARL DEWEY
Build a little - Test a little


Dustin said:
I need to combined certain customers first and last name into one field. Can
I write a query to do this? And only to the ones that need it?
 
A

Al Campagna

Paul,
First issue... don't use the name "Name" for a table field name. Name
is a reserved word in Access.
As a general rule, always split a name field into, at least, FirstName
and LastName, and... if needed, the Salutatory (Mr./Mrs), MiddleInitial, or
Suffix (Esq/III).

Now... if *ALL* your name entries are of the form FirstName + a space +
LastName, then...
(I'll use the name [FullName] for your current name field)
FirstName = Left(FullName, InStr(FullName," ") -1)
LastName = Mid(FullName, InStr(FullName," ") +1)

This will not work in all cases, such as "Alan Van Scriver", or "John J.
Rockefeller", but hopefully it will work on most entries.

But... you really should break out the FullName into two discrete
fields. Add a FirstName field and a LastNAme field to your table, and
populate those fields with an update query, using the criteria stated above.
Best not to continue with what you have now.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

pauld said:
Karl,

I noticed this thread and I'd like to ask your advice on the opposite
challenge.

The names in my NAME field are "John Smith" and "Frank Jones", etc

I need to create a report that will show the names sorted by last name,
ie,
Jones, Frank...and Smith, John.

How would I do that?

Thanks.

KARL DEWEY said:
I need to combined certain customers first and last name into one
field.
Full Name: [FirstNameField] & " " &[LastNameField]
OR
Name: [LastNameField] & ", " &[FirstNameField]
Can I write a query to do this? And only to the ones that need it?
You need to figure out the criteria for this.
--
KARL DEWEY
Build a little - Test a little


Dustin said:
I need to combined certain customers first and last name into one
field. Can
I write a query to do this? And only to the ones that need it?
 

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