Forum Discussion
New to access trying to print a car's specific info to a form and report
I have built a database for an auto repair shop and have it all done except for one detail I need to show up on the order form and the report printout.
I have a table that holds all of the cars for a specific customer and I would like to be able to pick a car from a customers multiple cars. The table I have has an "automobileID" (key) and a customerID (foreign), I'm just not clear how to get this in a dropdown so the person entering the data can choose from the specific cars. The thing is, the dropdown has to have the following fields from the automobile table, "make, model, mileage, VIN, EngineNumber, etc.., it's all listed in the autoT and related to the customer and to the order for that specific car. Any help would be so appreciated, thank you so much. Best Regards, Tony
Access provides a really good mechanism for requirements of this sort.
Use a main form/sub form design.
The main form is bound to the Customer table.
The sub form embedded in that main form is bound to the automobile table.
The subform control (in which the automobile form is embedded) has a property that controls which records from the automobile table appear in the subform, the
Master Linking FieldLink Master Fields and theChild Linking FieldLink Child Fields properties. This means that the automobiles displayed in the subform will be only those where the CustomerID is the same as the CustomerID for the currently selected record in the main form.Because the subform can be displayed in Continuous view, ALL of the current customer's vehicles are displayed in full and you can select the one you want.
A similar mechanism is available for reports/subreports.
5 Replies
- George_HepworthSilver Contributor
Access provides a really good mechanism for requirements of this sort.
Use a main form/sub form design.
The main form is bound to the Customer table.
The sub form embedded in that main form is bound to the automobile table.
The subform control (in which the automobile form is embedded) has a property that controls which records from the automobile table appear in the subform, the
Master Linking FieldLink Master Fields and theChild Linking FieldLink Child Fields properties. This means that the automobiles displayed in the subform will be only those where the CustomerID is the same as the CustomerID for the currently selected record in the main form.Because the subform can be displayed in Continuous view, ALL of the current customer's vehicles are displayed in full and you can select the one you want.
A similar mechanism is available for reports/subreports.
- NINER11Copper Contributor
George_Hepworth Thank you so much sir, the idea of adding a continuous form as a subform works perfectly. Thank you very much I'm very happy.
- NINER11Copper Contributor
George_Hepworth Thank you and I'm sorry for the late reply as I had to get something working for them quickly, so I improvised until I could learn a more efficient process which I believe you have provided. I'll give it a try today and get back with you. Thank you again so much for your help. Best Regards, Tony.
- Harun24HRBronze ContributorI assume you need SQL query as dropdown row source. Can you share a sample database file here and screenshot of what you want?
- NINER11Copper ContributorThank you so much and my apologies for the late reply. I'll provide screen shots of what I'm talking about once see if the alternate solution works for what I need. Thank you again so much. Best Regards, Tony.