How to link- cell in Table A and cell in Table B?

N

Novis

Would you please teach me a method to link- Sample Corporation cells in below
Table A and Table B-, not a method to relate- Names column in the Table A and
Owners column in the Table B if you would be so kind to me?

Software's Name: Microsoft Office Access 2003 (Access) .
Operating System's Name: Microsoft Windows XP Professional Version 2002
Service Pack 2 (WinXP).

The Access and WinXP contains the Table A and Table B.

The Table A's quasi, partial appearance in Datasheet view:
---------------------------------------------------
Organizations : Table
---------------------------------------------------
| ID# | Names | Types
---------------------------------------------------
| 10| Sample Corporation| Corporation
---------------------------------------------------

The Table B's quasi, partial appearance in Datasheet view:
-------------------------------------------------------------
Websites : Table
-------------------------------------------------------------
| ID# | RegisteredDomainNames | Owners
-------------------------------------------------------------
| 20| Sample.com | Sample Corporation
-------------------------------------------------------------

Reason of asking of the teaching:
1. I would like to link the cells.
2. I searched whole, this Access Database Office Disccussion Group, but
haven't found the method.
3. I also googled the method, but haven't found the method.

Thank you for your time and help for me!
 
K

Klatuu

I don't see anything in your example that shows a field where the two might
be joined. I am thinking your tables are not properly normalized. Table A's
ID is 10 and Table B's is 20. Usually, when I see ID or somethigID, I expect
it to be either a primary or foreign key used for relating tables.
Table A seems to have the correct fields and is describing a customer or
client base. Table B seems to be a list of domain names owned by the client
in Table A. If that is the case, there should be a field in Table B that
points to the owner's record in Table A. My guess is ID in Table B is its
primary key. I think you need another field in Table B that contains the
primary key of Table A. In this case it should contain 10.
 
J

John W. Vinson

Would you please teach me a method to link- Sample Corporation cells in below
Table A and Table B-, not a method to relate- Names column in the Table A and
Owners column in the Table B if you would be so kind to me?

The first thing to realize is that a relational table *is not a spreadsheet*.
It has no "cells". Tables have Fields, and you can link two tables by the
value in a field.
The Access and WinXP contains the Table A and Table B.

The Table A's quasi, partial appearance in Datasheet view:
---------------------------------------------------
Organizations : Table
---------------------------------------------------
| ID# | Names | Types

Is there a field within the Websites table for OrganizationID? Or is the only
field in common the fields [Names] and [Owners]? If so, create a new Query;
add the tables [Organizations] and [Websites]. If Access doesn't do so for you
automatically, drag the Organizations [ID#] field to the matching field in
[Websites]; if it's just the names, drag the [Names] field to the [Owners]
field to make a link. You can then include fields from either table in the
query, base a Report or Form on the query, etc.
Reason of asking of the teaching:
1. I would like to link the cells.

What result do you want to come from this linking? What do you expect to
happen when you link?

You may need to learn some of the fundamental principles of relational
databases. Check out the tutorials at:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

A free tutorial written by Crystal (MS Access MVP):
http://allenbrowne.com/casu-22.html

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

John W. Vinson [MVP]
 
K

Ken Sheridan

When you say 'link' do you mean that you wish to return the matching rows
from the two tables? If so you can join the tables in a query on the Names
and Owners columns, assuming that the values in the Names column are unique,
i.e. it’s a candidate key of Organizations. A simple query would be:

SELECT Names, Types, RegisteredDomainNames
FROM Organizations INNER JOIN Websites
ON Organizations.Names = Websites.Owners;

If you wish to restrict the result set to just those rows for Sample
Corporation add a WHERE clause:

SELECT Names, RegisteredDomainNames
FROM Organizations INNER JOIN Websites
ON Organizations.Names = Websites.Owners
WHERE Names = "Sample Corporation";

If its something else you have in mind perhaps you could explain in more
detail.

Incidentally tables don't have 'cells'; they have rows and columns, also
known somewhat inaccurately as records and fields (the latter really apply to
sequential file systems where records and fields are identified by position,
not tables where they can only be identified by name).

As you are referencing the Names column rather than the ID# column of the
Organizations table the ID# column is redundant and you could delete it and
make Names the primary key. Alternatively you should Change the Owners
column in Websites to a column of the same data type as the ID# column in
Organizations and reference that 'surrogate key' column rather than the Names
column.

BTW, rather than using a generic name like ID# for the keys I'd suggest
something more explicitly descriptive such as OrganisationID and WebsiteID.
This makes it clear which is being referred to.

Ken Sheridan
Stafford, England
 
N

Novis

Thank you Klatuu and Ken Sheridan for your time and help for me!

I modified the tables, and;

The Table A's quasi, partial appearance in Datasheet view:
-------------------------------------------------------------
Organizations : Table
-------------------------------------------------------------
| | ID# | Names | Types | Website
-------------------------------------------------------------
|+| 10 | Sample Corporation| Corporation | 20
--------------------------------------------------- ----------

The Table B's quasi, partial appearance in Datasheet view:
-------------------------------------------------------------
Websites : Table
-------------------------------------------------------------
| | ID# | RegisteredDomainNames | Owners
-------------------------------------------------------------
|+ | 20 | Sample.com | 10
-------------------------------------------------------------

I linked the cells, but have a problem.

Location of expand button, +, in the Table B: leftmost column, not between
RegisteredDomainNames column and Owners column in the Table B.

How to fix the expand button between the RegisteredDomainNames column and
Owners column, not at the leftmost column?

I am really frustrated on this, position of the button, so please teach me a
method of the fixing if you would be so kind to me.

Thank you!
 

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