Results 1 to 2 of 2
  1. #1
    anemoskkk is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2011
    Posts
    12

    Exclamation One to one relationship

    Hi

    I have these two tables and I want a one to one relationship between them but when I create both tables in Access it shows them as 1 to many relationship in the relationship database. Could you please tell me whats wrong?

    This project is about a company which is a light recovery operator offering a package of towing services and roadside recoveries. The job could be an accident or a breakdown. The vehicle would be either fixed at the roadside or towed to the company. If towed, we have to store details of what happened to the vehicle next. In order not to have blanks I created a table called: 'TowedInformation' which stores the notes when it is towed.


    CREATE TABLE Job(
    JobID AUTOINCREMENT PRIMARY KEY,


    ArrivalTime TIME,
    DepartureTime TIME,
    JobDate DATE,
    AddressLine1 TEXT,
    POSTCODE TEXT,
    City TEXT,
    GPSCoordinates NUMBER,
    Cost NUMBER,
    TransporterPlateID TEXT NOT NULL REFERENCES Transporter(TransporterPlateID),
    VehiclePlate TEXT NOT NULL REFERENCES Vehicle(VehiclePlate));


    CREATE TABLE TowedInformation(
    JobID AUTOINCREMENT PRIMARY KEY REFERENCES Job(JobID) ,
    Notes TEXT);

    Thanks a lot

  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    Why not add the TowedInformation note to your main table? If you need to differentiate between towed and not towed, you could have a yes/no field called towed.

    As far as your one-to-many problem....it's not really a problem. The main reason for having a separate table like you do would be if it was a one to many relationship.

    I would say the JobID field in the TowedInformation should not be an autoincrement field....just a Long. It wouldn't be bad to have another id field in this table called TowID...that one should be autoincrement....but not JobId.

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

Similar Threads

  1. Relationship
    By ClownKiller in forum Database Design
    Replies: 13
    Last Post: 12-21-2010, 05:49 PM
  2. One to one relationship
    By ManvinderKaur in forum Database Design
    Replies: 2
    Last Post: 06-28-2010, 05:37 PM
  3. one to many relationship?
    By cowboy in forum Access
    Replies: 3
    Last Post: 06-16-2010, 02:37 PM
  4. Relationship
    By pcandns in forum Access
    Replies: 2
    Last Post: 04-01-2009, 09:32 AM
  5. MAY TO MANY RELATIONSHIP
    By fadone in forum Database Design
    Replies: 2
    Last Post: 12-20-2005, 09:03 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