Results 1 to 7 of 7
  1. #1
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31

    Linking three filed to one

    Hello All,

    I have a database, that holds information on a customer, then links information on that customer such as their contacts, site names and addresses, contract etc. See attached screen print:



    Basically what I would like to know is how would I link these three fields to the one on the screen print so that it all relates, and when viewed shows all the data?

    Sorry if this is confusing.

    thanks in advance,
    Click image for larger version. 

Name:	Relationships.jpg 
Views:	15 
Size:	58.2 KB 
ID:	12021

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you're not likely to get the results you want with a single query because you have one to may relationships with tables that are unrelated to one another (contact data is not related to site data). If you're trying to generate a report you are likely going to have more success with reports/subreports than trying to build a single query that has everything on it.

  3. #3
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31
    Sorry maybe im not being clear enough, I want to allow users to have the database allow them to add a customer, then add data on their site name and address, then add contacts etc. so all the identifiers link.

    Without manually typing the ids, I want the database to be able to know that you are adding say a site name, for customer (*generic name*).

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would first normalize your table structure before worrying about forms.

    For instance, you have a table for customer data. In "Customers Data", you have one field for the customer name. Is this a company? If an individual, there should be a field for first name and a field for last name. If you have one field, how will you control if the name is entered as "Jon Smith" or "Smith, Jon"?
    No other data for the customer?
    Is "Contact Data" different than "Customer Data"?
    One field for "Contact Name"?

    Why are there two tables for the sites? Can a site be in two locations at the same time?


    Other things I noticed:
    ** You are using spaces in field names (and table names)
    ** You are using special characters in field names (the underscore is ok to use)
    The primary key field is usually the first field in a table. (At least that was the convention I was taught)

  5. #5
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31
    Hi Steve thanks for the input.
    Basically the 'customers' table will be a company, then that company will have contacts, as well as contracts, and many different sites, and a site will have a portfolio of resources.

  6. #6
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31
    Hello Steve,

    Does this look better?

    Click image for larger version. 

Name:	Relationship (complete).png 
Views:	6 
Size:	39.1 KB 
ID:	12057

    Ignore the first Image that was the wrong screen shot I uploaded.
    Attached Thumbnails Attached Thumbnails Relationships.jpg  
    Last edited by LukeJ Innov; 04-25-2013 at 07:39 AM. Reason: Added wrong screen print, whoopsie!!

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Yes, the names are better (referring to the top image)

    Basically the 'customers' table will be a company, then that company will have contacts, as well as contracts, and many different sites, and a site will have a portfolio of resources.
    This helps


    One customer (company) can have many contacts. (Doesn't a customer (company) have an address/phone/...??)
    One customer (company) can have many contracts. (Not sure about this one. Are the contracts related to the customer or to the site?)

    One contact can have many sites and one site can have many contacts. Many to many, so a junction table ("ContactSite") . OK, but the name fields are unnecessary. Just need the two foreign key fields - I also add an autonumber PK field.

    One contract can be for many sites. One site has one contract? Can one site have more than one contract? (If so, need a junction table.)

    One site can have many portfolios.
    One portfolio can have many products.


    Why is the "Sites" table named "CustomerAddress"? Confusing..

    The date fields in "Contract" have "00/00/0000" in the name??? That is unnecessary... (special character used .... and a lot of extra typing)


    IMO, no one but the developer should see the underbelly (table and field names) of the database so using "Proper" english, grammar and punctuation is unnecessary. On forms and reports, labels are used to describe the controls - like "First Name" instead of "FName" (what I use)



    There are many more people here that are better at structure design than me; June7, rpeare and Orange to name a few. Hopefully they will comment also.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sum one filed based on its contsest
    By BorisGomel in forum Access
    Replies: 2
    Last Post: 03-29-2012, 03:01 PM
  2. Query: Two tables With Yes/No Filed
    By Judasdac in forum Queries
    Replies: 6
    Last Post: 10-17-2011, 12:24 AM
  3. Replies: 0
    Last Post: 03-04-2011, 10:28 AM
  4. Sum of a categorized filed
    By Costa in forum Reports
    Replies: 0
    Last Post: 02-24-2010, 07:34 AM
  5. Upercase in filed of form
    By miziri in forum Forms
    Replies: 2
    Last Post: 12-23-2009, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums