Linking First and Last Names

N

neetkleat

Right now I have a table with first and last names of customers as separate
fields.

I have a few other tables with their first name, last name, and other
fields. These tables have to remain separate for some queries I am running.

How do I link the First Name and Last Name fields so that when I enter a
last name in another table, the first name(s) that go with that last name
show up as well?
 
N

neetkleat

They are combo boxes right now, but that could change if it would make things
easier. Unfortunately the fields exist separately so if I have:

Last Name: First Name:
Smith John
Anderson David
Jackson Michael

so in another table, if I sort by ascending order for each of the fields, I
could have:

Last Name: First Name:
Anderson David
Jackson John
Smith Michael
 
W

Wayne-I-M

1st Don't add the the names together in a table
Each part of the name needs a seperate field to hold it - tables are for
storing data only - not for working - except in a full circumstances.

Next
The important thing to remember about any database that contains details of
people is that you need to forget the name (sounds strange I know). By this
I mean that the name does not indicate the person in the record.
You may have 2 John Smith or 25 Jane Brown – how do you differentiate
between these people.
For a database you assign a unique identifier to each record. THAT unique
identifier IS that the record.
So if you have a list of names (people) each person will have a record and
each record will have an ID field. Normally this is an auto number – but it
can be other things.

So
Record number 123
1st Name = John
2nd Name = Smith

Record number 124
1st Name = Jane
2nd Name = Brown

Record number 125
1st Name = John
2nd Name = Smith

So in your case it is the “record†not the name that you need to get 1st and
then simply bring in some other field from the same record (in this case)

So you have a table with these fields
ID field – 1stName – LastName
You combo box should have a source something like this
SELECT [TableName].[ID], [TableName].[stName], [TableName].[LastName] FROM
[TableName] ORDER BY [LastName], [1stName];

You can join these name together like this in a;
Form/Report
=[1stName&" "&[LastName]

Query
FullName:[1stName&" "&[LastName]

HTH
 
W

Wayne-I-M

sorry - typo

=[1stName]&" "&[LastName]

Query
FullName:[1stName]&" "&[LastName]

there was a missing ]

--
Wayne
Manchester, England.



Wayne-I-M said:
1st Don't add the the names together in a table
Each part of the name needs a seperate field to hold it - tables are for
storing data only - not for working - except in a full circumstances.

Next
The important thing to remember about any database that contains details of
people is that you need to forget the name (sounds strange I know). By this
I mean that the name does not indicate the person in the record.
You may have 2 John Smith or 25 Jane Brown – how do you differentiate
between these people.
For a database you assign a unique identifier to each record. THAT unique
identifier IS that the record.
So if you have a list of names (people) each person will have a record and
each record will have an ID field. Normally this is an auto number – but it
can be other things.

So
Record number 123
1st Name = John
2nd Name = Smith

Record number 124
1st Name = Jane
2nd Name = Brown

Record number 125
1st Name = John
2nd Name = Smith

So in your case it is the “record†not the name that you need to get 1st and
then simply bring in some other field from the same record (in this case)

So you have a table with these fields
ID field – 1stName – LastName
You combo box should have a source something like this
SELECT [TableName].[ID], [TableName].[stName], [TableName].[LastName] FROM
[TableName] ORDER BY [LastName], [1stName];

You can join these name together like this in a;
Form/Report
=[1stName&" "&[LastName]

Query
FullName:[1stName&" "&[LastName]

HTH
--
Wayne
Manchester, England.



neetkleat said:
They are combo boxes right now, but that could change if it would make things
easier. Unfortunately the fields exist separately so if I have:

Last Name: First Name:
Smith John
Anderson David
Jackson Michael

so in another table, if I sort by ascending order for each of the fields, I
could have:

Last Name: First Name:
Anderson David
Jackson John
Smith Michael
 
J

John W. Vinson

Right now I have a table with first and last names of customers as separate
fields.

I have a few other tables with their first name, last name, and other
fields. These tables have to remain separate for some queries I am running.

How do I link the First Name and Last Name fields so that when I enter a
last name in another table, the first name(s) that go with that last name
show up as well?

What kind of "link"? How do you want them to "show up"? Are you editing
directly in the table datasheet (a bad idea) or in a Form? What beneifit do
you get from seeing Fred, Fred, Fred, Janet and Zachary show up when you
select the lastname Brown?
 

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