Parts table: multiple customers with duplicating primary keys

Riter19

New member
Local time
Today, 11:14
Joined
Feb 16, 2016
Messages
5
hello all. I am new to access and not real comfortable with computers. I am building a data base to keep track of our maintenance customers, there aircraft, and the parts we buy for there aircraft. I was successful in creating the customer table and aircraft table and combining those tables into a form.
The common ID between the tables is the aircraft N Number; ie: N3456T

Now I need to track the parts to make sure all parts get charged to the correct aircraft. I set up the table as follows;

Costumer Parts:

Primary Key: N Number
date ordered
Date received
Quantity
Part Number
Description
List price
Cost
Total

The problem I am having is that the same N Number has many parts attached to it. Do I need to create a separate parts table for each Aircraft? Is there an easier way to do that? The goal is at billing time I can generate a report with all the parts associated with that aircraft.
My next question is how do I get quantity * list price = Total
Can I get a grand total on my report?
I know this is a lot. I would really appreciate any help you can give.
Thank you.
 
You would not have a seperate table for each aircraft, you would put a field in that table to designate which aircraft the part was for. First, though I would work on your naming.

1. Use only alphanumeric characters and underscores in table/field names (that means no spaces). It makes coding easier down the line and helps eliminate confusing when discussing things on this board. When I see 'Costumer Parts', I'm not sure if that's your actual table name, or just your use of common language to refer to the table that contains parts. If you type CustomerParts, I know both what its for and its actual name within your system.

2. Customer Parts is a bad name for that table anyway. Didn't you say that parts are for aircraft? I mean a customer can own multiple aircrafts right? But a particular part belongs to a specific aircraft, so it would be better to name it AircraftParts, right?

Non-Naming issues:

3. I don't think you can use N Number as the primary key for the table you posted. A primary key has to be unique. That means an aircraft can only have 1 record in that table, which means if 2 different replacement parts are needed, you can't add a second record. N Number is needed for this table, but it shouldn't be the primary key.

4. As long as you have an N Number in the parts table you will be able to use the same table for all parts.

5. Don't use total fields in a table. Instead you use a query and get your totals there.

Can you apply my first 2 suggestions to your database and post the structure?
 
Thank you very much. I see I have a lot to learn. I will make those changes and post.
 
You might speed up your learning by:

Watching these 8 videos on Database starting here.

Then spend 30 - 45 minutes working through this tutorial.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom