Results 1 to 12 of 12
  1. #1
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8

    rental contract database

    HI EVERYONE

    this is my first topic here, anyway i'm not efficient in access, so i need help guys

    i have an idea of a data base related to rental contract which includes this issue
    1-customer
    - Costumer name
    - Type de revenue
    - Branche
    - ACTIVITE



    2- contract

    - Customer name
    - Agreement
    - Type agreement
    - Manière facturation
    - Location Code

    - Date signature
    - Date begining contrat
    - Date Fin contrat

    3- invoice
    - Customer name
    - Agreement
    - Manière facturation (mensuelle, trimestrelle, annuelle)
    - Location Code
    - Descriptions
    - Area (m²)
    - Monthly price without vat
    - Vat
    - TTC

    a customer may have many contrats with many location code
    a customer may have many invoices

    i have problems about choosing the primary key, and about the establishment of the relationships

    thank u in advanace

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Base on what you have say.

    The table "Customer" will have "CustomerNo" (create this field is recommended) or "CustomerName" as primary key.
    Create a "Location" table with "LocationNo" as primary key.
    The table "Contract" will have "CustomerNo" and "LocationNo" as its primary key (as long as there is no duplicate "CustomerNo" and "LocationNo" combination).
    The table "Invoice" will have "InvoiceNo" (create this field is recommended) and "CustomerNo" and "InvoiceNo" as its primary (as long as there is no duplicate "CustomerNo" and InvoiceNo" combination).

    Hope this helps.

  3. #3
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8
    Quote Originally Posted by lfpm062010 View Post
    Base on what you have say.

    The table "Customer" will have "CustomerNo" (create this field is recommended) or "CustomerName" as primary key.
    Create a "Location" table with "LocationNo" as primary key.
    The table "Contract" will have "CustomerNo" and "LocationNo" as its primary key (as long as there is no duplicate "CustomerNo" and "LocationNo" combination).
    The table "Invoice" will have "InvoiceNo" (create this field is recommended) and "CustomerNo" and "InvoiceNo" as its primary (as long as there is no duplicate "CustomerNo" and InvoiceNo" combination).

    Hope this helps.
    for location do you mean location code as mentionned in my file, so you advised me to create another issue whose name location

  4. #4
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    I recommended to create a "Location" table to store your location information and use "LocationNo" as its primary key. It is similar to your "Customer" table.

  5. #5
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8
    i have resumed what you have say in below, please help me in order to define the relations between tables
    please note

    a customer may hane many agreements
    an agreement may have many locations code
    Click image for larger version. 

Name:	bad.jpg 
Views:	20 
Size:	96.6 KB 
ID:	19976

  6. #6
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Maybe something like this.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	21 
Size:	26.1 KB 
ID:	19977

  7. #7
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8
    EXCUSE ME but i didn' t understood the relations , first i don't need invoices table

    - all description mentionned in the table invoices , i need them in table contract

  8. #8
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    There are many way to do what you need. I gave you my opion on how to design your relationships based on your first post.

    Good luck with your project.

  9. #9
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8
    Quote Originally Posted by lfpm062010 View Post
    There are many way to do what you need. I gave you my opion on how to design your relationships based on your first post.

    Good luck with your project.
    thank u veru much

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would suggest using pencil and paper to design your tables and relationships..
    You said "a customer may have many agreements".
    Can an agreement (Contract) have many Customers?

    If "an agreement may have many locations code", I would think a location can be in many agreements (contracts). This is a many to many relationship, so there needs to be a junction table.

    If there is only one customer to an agreement (contract), I see 4 tables:
    tblCustomers
    tblContracts
    tblLocations
    tblContractsLocations (junction table)

    I don't know what all of the fields are for, but I think they are in the correct tables with the exception of these fields:
    "Type de revenue", "Branche" and "ACTIVITE".
    I think they should be in the contracts table.
    Attachment 20053

    Attachment 20051

  11. #11
    chermiti is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    8
    thank you for the help

    for an agreement, he's related to one customer

    for the location code it's related also to only one agreement and one customer

    i don't know if the relationships will change after this information

  12. #12
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    One agreement has one location and one location is in one agreement

    You could have
    Attachment 20061

    or you add the fields in tbLocations to tblContracts.
    I would leave it like the picture above. The location data should not have to be retyped again for next agreement.

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

Similar Threads

  1. Rental database - balance entry
    By Newby in forum Access
    Replies: 2
    Last Post: 03-04-2015, 03:42 PM
  2. Banquet Hall Rental Database - Custom ID
    By Ryanm0085 in forum Database Design
    Replies: 13
    Last Post: 02-04-2015, 09:58 AM
  3. Manlift Rental Database Template
    By emerbrennan in forum Access
    Replies: 1
    Last Post: 08-15-2013, 08:03 AM
  4. Replies: 16
    Last Post: 01-10-2013, 07:14 PM
  5. Help Designing a Frac Tank Rental Database
    By gwilliams119 in forum Database Design
    Replies: 4
    Last Post: 01-04-2013, 08:47 AM

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