Forum Discussion
All I need is to be able to choose a car from the customers list of cars
I've designed a database for an auto repair company and everything works great except for one issue with the invoice. The autoT Table is set to a customer in the CustomerT table, and in the AutoT Table are a list of the customers car(s) and the work orders in the OrdersT table. The AutoT form is a nested form on the OrderF form.
The problem that I'm having is that many customers have more than one car, and I need to be able to create a way to select "one" of the cars from the list of cars, when one of the cars have returned for additional repairs at a later date. I'll attach the database as well as the photos.
All I need is to be able to choose a car from the customers list of cars and to have it appear on the report/invoice without the other cars appearing. Thank you in advance.
Sorry it took so long, but I finally figured out the problem. You do NOT store the automobile ID with the Order for work on that ID. All of the foreign key fields for AutomobileID in the Order table are 0.
I was struggling to figure out why none of the usual methods worked, and as a last resort "looked at the data". LOL.
Lesson re-learned. Always start with the data when problems arise.
10 Replies
- George_HepworthSilver Contributor
Sorry it took so long, but I finally figured out the problem. You do NOT store the automobile ID with the Order for work on that ID. All of the foreign key fields for AutomobileID in the Order table are 0.
I was struggling to figure out why none of the usual methods worked, and as a last resort "looked at the data". LOL.
Lesson re-learned. Always start with the data when problems arise.
- NINER11Copper Contributor
Nothing to apologize for I'm grateful for your help. Thank you so very much for your reply.
I've Deleted the AutomobileID from the OrderT but I'm still getting multiple cars, should I create a new combo box or listbox to the editied OrderT? Thank you again so much, I'm new to this so all of your help is so appreciated.- Tom_van_StiphoutIron ContributorI'm sure George did not mean "delete the AutomobileID from Orders". If you did that, how would you know which auto the order is for? He meant "do not store 0, but the actual AutomobileID.
And while you are at it: remove the default on Orders.AutomobileID, and set the field to be required. After all, all orders must have an auto associated.
- Tom_van_StiphoutIron ContributorThe database zip file is empty. Same player shoots again.
- NINER11Copper ContributorCorrect zipfile has been uploaded, thanks for the heads up.