Results 1 to 3 of 3
  1. #1
    photogwa is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    1

    Question about linking some tables together

    Hi.



    I'm fairly new to database design and I have a question about relating some tables together.

    Let me give you an example to help explain my question. Let's say we have a table that describes a whole process, in this instance, every time one our shop vehicles goes to our auto shop to have an inspection done. So we have a table called "VehicleInspections". It has fields like ID, vehicleID, inspectionStartTime, inspectionStopTime, which maintenance bay it's in, etc. Now, let's say we have another table called "MaintenanceActions" that list all the maintenance actions done on a particular vehicle (discovered during the vehicle inspections). So this has fields like ID, vehicle Inspection ID (foreign key from ID in VehicleInspections), vehicleID, status of the action, remarks, etc. Lastly, let's say we also have a table that lists the vehicle IDs for all of our vehicles. Now, if I setup a lookup in table VehicleInspections in the vehcileID field to the VehicleIDs table, should I do the same in the MaintenanceActions table? Or should I/can I link the vehicleID field in MaintenanceActions to the vehicleID field in VehicleInspections (which is a lookup of the field in VehicleIDs)?

    Hopefully I didn't lose you.

    Basically, if I have table with a list of actions that is attached to a list of processes, should I link the thing they have in common (vehicleID) in each table to the lookup list, or just one to the lookup list and the other one back to the one that refers to the lookup list.

    Keep in mind, this is just an example to explain my question. Also, not sure if it matters, but I will be not using the Access program to read and write the data.

    Thanks for your help,
    Jason

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You shouldnt need a lookup for vehicle ID...it should be a PARENT/CHILD.
    If you are in a vehicle (the parent) then all childs, inspection, actions become children and the Vehicle is automatically added via the form.\
    Start inspection of vehicle A
    vehA is parent
    subform Inspection #001 begins using vehA
    Actions are added to inspection. (or to a repair) (ok lookup happens here from the Action table)
    stop inspection.
    All data is recorded under the vehicle parent.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Here is a draft data model based on your post that may help. You may have more fields and tables but this is my attempt to identify vehicle, inspection, maintenance actions.
    Attached Thumbnails Attached Thumbnails VehicleInspection.jpg  

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

Similar Threads

  1. Question on properly linking tables
    By wsneeden in forum Database Design
    Replies: 4
    Last Post: 04-01-2014, 01:08 PM
  2. splitting and linking question
    By TravisB in forum Access
    Replies: 1
    Last Post: 12-05-2012, 01:35 PM
  3. Linking Question
    By Petersona01 in forum Access
    Replies: 2
    Last Post: 08-02-2011, 09:02 AM
  4. Replies: 0
    Last Post: 03-04-2011, 10:28 AM
  5. simple linking question I hope
    By wing8lc in forum Queries
    Replies: 4
    Last Post: 01-21-2010, 03: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