Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2008

Tip: Looking for answers? Try searching our database.

How do I add data in a table and have it relate to another.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KB - 02 Jan 2008 05:06 GMT
I have set up 4 tables. The first relates to client details(names and
addresses). The other 3 relate to products and courses. When I enter the
personal details table with an auto key, how do I then enter details in the
other tables and have it relate to the person on my client details
Signature

KB

Baz - 02 Jan 2008 05:18 GMT
I assume that the tables you wish to relate each have a foreign key which
relates to the autonumber primary key on your main table.

The usual thing to do would be to:

-    create a form for each of the 4 tables
-    on the main table's form, add the three other forms as subforms, linked
on the primary key/foreign key field.

It will help (with lots of things) if you first open the relationships
window and set up the relationships between the tables.

>I have set up 4 tables. The first relates to client details(names and
> addresses). The other 3 relate to products and courses. When I enter the
> personal details table with an auto key, how do I then enter details in
> the
> other tables and have it relate to the person on my client details
John W. Vinson - 02 Jan 2008 05:25 GMT
>I have set up 4 tables. The first relates to client details(names and
>addresses). The other 3 relate to products and courses. When I enter the
>personal details table with an auto key, how do I then enter details in the
>other tables and have it relate to the person on my client details

That depends on the relationship between the tables. Which of the following
correctly describes the relationships:

Each Person can take zero, one, or many Courses.
Each Course is taken by either zero or one person, never more.

or

Each Person can take zero, one, or many Courses.
Each Course is taken by zero, one, or many People.

Similarly for Products.

I'm guessing that the latter is accurate - a "many to many" relationship. If
so you need *three more tables* to implement the relationship. In the Courses
example, you might have a table named Enrollment, with fields for the PersonID
(a link to the primary key of the Client table) and the CourseID (a link to
the primary key of Courses). If ten people are enrolled in a course you'll add
ten records to this table - using a Subform on the Clients form, probably.

See the tutorials here for more resources:

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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.