Solved

Table relationship and subform help for a beginner

Posted on 2014-04-22
2
361 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
Comment Utility
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
Comment Utility
Thanks for the info, I think I'm on the right track now.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now