Solved

Table relationship and subform help for a beginner

Posted on 2014-04-22
2
366 Views
Last Modified: 2014-04-22
I have a Projects table that has multiple notes with each project. I have a Company table with multiple notes with each company record and a Contacts table with multiple notes with each Contact record.

I want to create a Notes Table with NotesID, Date of Note, and Note as the fields but am having trouble putting the relationships together properly.

My end goal is to have the Notes show up as subforms on each of the Projects, Company, and Contacts Forms and only the notes that are specific to each of those records even though they are in different tables.

I have a NotesID field in each of the other tables and link it to the Notes table by NotesID. I've tried this several different ways and don't get errors but get different results than what I expect or don't get any results even though I have create notes already. So I would like to work through this from the beginning if possible. Thanks for the help.
0
Comment
Question by:circa62
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40015393
I think you perhaps have it backwards.

Your Notes table should store the value of the "parent" table, not the other way around. Since you have multiple "types" of Parents, you'll need to store that as well, or create separate tables for each "parent note".

So your notes table should look something like this:

NoteID
ParentID
ParentType
NoteText

If I then want to store a new Note for a Customer who has an ID value of 1234, the record would end up looking like this:

<NoteID> , 1234, 'Customer', 'This is my note text'

You could then create a Subform based on that table, and use the subform on your various parent forms. Set the Master/Child link fields to <YourParentIDFieldName>/ParentID. You'll also want to include a hidden Textbox (named, perhaps, "txNoteType") on each form, and use that as a second pair of link fields. Set that HIdden textbox to "Customer" for the Customers form, "Projects" for the Projects form, etc. Then add a second set of Link fields, with the Master/Child as txNoteType/ParentType.
0
 

Author Closing Comment

by:circa62
ID: 40015477
Thanks for the info, I think I'm on the right track now.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question