I have a question regarding relationships between tables (Parent to its child tables). Here is my situation of this Access 2002 database program.
Introduction:
I am creating a form for people to enter in properties for my project at school. I want people to be able to select a county that they live in (I only put 3 counties where I live, so they must live near me), and then input their full name, address, square ft, phone number, loan information, costs to sell, repairs, and so on and so on. After they input, they press the button to save the data. After it is saved, I want it to go to a query so that I can easily sort the data from counties and then by city.
Problem: Is defining the relationship from the Parent Table County to the rest of the tables, which I believe they are the children of County. Since, there is no relationship or not correctly related to, I cannot input any data when I test out the program.
Tables:
(Table1)Parent: Counties
Table2: Background (city, full name, phone number, sqft, etc.)
Table3: Worth: How much the house is worth.
Table4: Loan Information (Only made one table for loan information, b/c if the person had two mortgages/loans, they can just use this table or a duplicate of this table. I program in c++, so I would think you should make one table and reuse it. )
Table5: Total Loan information: This holds all the totals of the loan information
Table6: Retail: This consists of costs of the home to fix, refinance, realtors costs, etc. and also extra comments (about 5 lines worth).
How I tried to make this work. Of course this did not work but maybe you guys and help me out what I did WRONG.
I tried two methods in trying to make my table county as the parent table for the rest of the tables that I designed (The 5 tables). With my understanding of the relationship from the book I bought, at least one field name has to be the same and the data type. My first take on this is, adding the county field name on all the tables because I thought this is how I can make County to be the parent table. When I did this, I open up the county table and view it, and there was a [+], which I pressed on, I can see one of my tables. This tells me that Contra Costa County controls one table. I am not sure why, I cannot see the rest of my tables.
At the same time, I open up a query and add all the tables there so that I can sort the info later on in the program.
Another method I used to try to get my parent table in control of all the tables is by selecting one of the field name in the tables and putting them in each in “one” table, set it as a primary key then I relate, by dragging the field name from that table to other, to define a relationship.
So far, when I drag my tables to the form, I can input but cannot save because it is not related to anything. I cannot remember how I did it before,(few weeks ago), I dragged all the tables to the form and when I saved it saves the data to the table and the query. The only problem is that some tables were not able to input.
This is my problem so far. I am trying to have one parent, County, control the rest of the tables, which are on one form. At the same time, I would like to put these tables into a query to be able to sort by county then by city.
Do you guys have any suggestions? Or even advice?
neszz
Introduction:
I am creating a form for people to enter in properties for my project at school. I want people to be able to select a county that they live in (I only put 3 counties where I live, so they must live near me), and then input their full name, address, square ft, phone number, loan information, costs to sell, repairs, and so on and so on. After they input, they press the button to save the data. After it is saved, I want it to go to a query so that I can easily sort the data from counties and then by city.
Problem: Is defining the relationship from the Parent Table County to the rest of the tables, which I believe they are the children of County. Since, there is no relationship or not correctly related to, I cannot input any data when I test out the program.
Tables:
(Table1)Parent: Counties
Table2: Background (city, full name, phone number, sqft, etc.)
Table3: Worth: How much the house is worth.
Table4: Loan Information (Only made one table for loan information, b/c if the person had two mortgages/loans, they can just use this table or a duplicate of this table. I program in c++, so I would think you should make one table and reuse it. )
Table5: Total Loan information: This holds all the totals of the loan information
Table6: Retail: This consists of costs of the home to fix, refinance, realtors costs, etc. and also extra comments (about 5 lines worth).
How I tried to make this work. Of course this did not work but maybe you guys and help me out what I did WRONG.
I tried two methods in trying to make my table county as the parent table for the rest of the tables that I designed (The 5 tables). With my understanding of the relationship from the book I bought, at least one field name has to be the same and the data type. My first take on this is, adding the county field name on all the tables because I thought this is how I can make County to be the parent table. When I did this, I open up the county table and view it, and there was a [+], which I pressed on, I can see one of my tables. This tells me that Contra Costa County controls one table. I am not sure why, I cannot see the rest of my tables.
At the same time, I open up a query and add all the tables there so that I can sort the info later on in the program.
Another method I used to try to get my parent table in control of all the tables is by selecting one of the field name in the tables and putting them in each in “one” table, set it as a primary key then I relate, by dragging the field name from that table to other, to define a relationship.
So far, when I drag my tables to the form, I can input but cannot save because it is not related to anything. I cannot remember how I did it before,(few weeks ago), I dragged all the tables to the form and when I saved it saves the data to the table and the query. The only problem is that some tables were not able to input.
This is my problem so far. I am trying to have one parent, County, control the rest of the tables, which are on one form. At the same time, I would like to put these tables into a query to be able to sort by county then by city.
Do you guys have any suggestions? Or even advice?
neszz