I’ve got tables with different vehicle types (cars, buses, motorbikes, trucks), and in order to hire them I want each one to have a unique vehicleID, so I created another table Vehicles that holds vehicleIDs and is linked to those tables. This way I can just hire vehicles.
To create a new car I have to first create a vehicle (with a unique vehicleID) and then create a car and select that vehicle by the ID.
Since the vehicleID is only useful for the link and is not relevant for the user, I wonder if there is a way to simplify it. For example that the cars form automatically creates and links a new vehicle when a new car is created.
Or, if there is an easier way to organize the data for the same goal.
Hello,
I believe you may need to layout the entire process before determining one small item. This is not done by many and only leads to either giving up or doing it all over.
With that said, it appears you are mixing set-up and actual leasing.
Creating vehicle records and linking to another file is all in the set-up process. This has nothing to do with (or it should not have) the actual leasing. In your leasing process, the vehicle chosen is from a list box. The list box contains the description and can store an ID. Construct the description from the connection to the vehicle via the id using SQL.
What is really missing from this process, and again one of the reasons for review, is how to determine what vehicles are available. Possibly a method to first determine the type wanted and a method to note the current process has made this vehicle unavailable.