Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Access: Many-To-Many Relationships
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   16 years ago

I received an email from a student today asking how to track employees and the hours they bill to each customer. Their programmers work on projects for customers, and they need to bill them accordingly.

You would need an Employees table and a Customers table, obviously. Now you'd need a BillableHours table so you can keep track of the hours each Employee spent working for each Customer. It would look like this:

  • BillableHoursID - AutoNumber
  • CustomerID - Number (Foreign Key)
  • EmployeeID - Number (Foreign Key)
  • HoursWorked - Number (Decimal, how many hours worked)
  • DateTimeWorked - Date/Time (To track what day the work was done)
  • Description - Text (a brief description)
  • Notes - Memo (for whatever)
  • HasBeenBilled - Yes/No (to track if these hours have been billed yet)

Now you have a third table that is related to both of the other tables. You can now generate reports for each EMPLOYEE (how many hours has Joe billed this month?) or by CUSTOMER (what do we need to bill XYZ Corp?)

You've created a many-to-many relationship between Customers and Employees using a JUNCTION or CROSS REFERENCE table. I cover this concept in detail in my ACCESS 2013 EXPERT 7 class and also my ACCESS RELATIONSHIP SEMINAR. There's also a free tutorial on it in my TIPS section: Access Many-To-Many Relationships.

The same situation arises if you have something like CUSTOMERS and what SERVICES they have received. You would have one table with your customers, another table containing a list of services, and then a third JUNCTION table that links them (and even might have details on that particular instance of service).

Customers:

  • 1, Joe
  • 2, Bill
  • 3, Sally

Services:

  • 1, Electrical
  • 2, Plumbing
  • 3, Painting

Junction:

  • 1, 2, 1, 1/1/08
  • 2, 1, 3, 1/2/08
  • 3, 1, 1, 1/5/08
  • 4, 3, 2, 1/8/08

This junction table says:

  • Record 1, Bill had Electrical work done on 1/1/08
  • Record 2, Joe had Painting done on 1/2/08
  • Record 3, Joe had Electrical work done on 1/5/08
  • Record 4, Sally had Plumbing done on 1/8/08

 

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Access: Many-To-Many Relationships
Get notifications when this page is updated
 
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 8:28:59 AM. PLT: 0s
Keywords: access many-to-many relationships junction cross-reference tips  PermaLink  Access: Many-To-Many Relationships