Forum Discussion
All I need is to be able to choose a car from the customers list of cars
- Jun 11, 2023
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.
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.
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.
- NINER11Jun 11, 2023Copper ContributorI'll be doing that now, and I have backups so going backwards in time is no problem. I'm an old guy still learning new things and I'm appreciative of all the help I've gotten from you all.
- Tom_van_StiphoutJun 11, 2023Iron Contributor
It is important to enforce Referential Integrity on all relations.
As it stands, you have orders without customer. Find and delete them with this query:
SELECT OrderT.*
FROM (CustomerT RIGHT JOIN OrderT ON CustomerT.CustomerID = OrderT.CustomerID) INNER JOIN OrderDetailT ON OrderT.OrderID = OrderDetailT.OrderID
WHERE (((CustomerT.CustomerID) Is Null));
SELECT ContactT.*
FROM CustomerT RIGHT JOIN ContactT ON CustomerT.CustomerID = ContactT.CustomerID;
Then enforce the relations.
OrderDetail.ProductName should never be blank. Delete the bad rows, and make the field required. Same for Quantity and UnitPrice. Again, you do not want illogical values.
OrderDetail.PD is too cryptic. Spell it out. If the values can come from a table, do that, so typos like LALABOR and LAOBOR are not possible. They don't look good on an invoice.
I added an Automobile dropdown to Orders form.
Also used LinkMasterFields/LinkChildFields for the subreport on OrderInvoiceR to pull up the Automobile, rather than the Customer.
New version is attached.
- NINER11Jun 18, 2023Copper ContributorGreetings and Happy Fathers Day. Having issues still with the dropdown (pics included). Using the unadulterated zip file that you thankfully uploaded for me, I'm not able to add new service items or cars for the customer, to the work order. The following error appears and I'm not sure what it's referring to as there is a field for AutoT. These photos taken this morning from a fresh unzip, no other customers added. Thank you so much if you can help me get this finished. Again, thank you so much.