Help on duplicate ID please

JohnWales

New member
Local time
Today, 12:57
Joined
Jan 25, 2006
Messages
5
:confused:
I have got to create a car hire db for a course i'm doing.
I have a vehicle table
I have a customer table
I have to be able to book more than one vehicle to a customer.
I tried putting vehicleID into my appointments table twice but that is wrong.
Any solution would be great.
 
You have a many to many relationship between vehicles and customers. Your appointments table should have a record for each vehicle/customer booking. This record will hold the ID of the vehicle and the ID of the customer. So if the customer has two vehicles, there will be two records with that customerID. If another customer books the vehicle at a later date, there will be another record with the same vehicle ID.

Do a search in these forums for 'many to many' and 'junction tables'.
 
Ok thanks for the advice i know what i have to do but i'm have gone completely blind to this. :(
Does anybody mind taking a look and seeing where i have gone wrong please?
 

Attachments

I've had a look and I'm not sure what your problem is. There isn't an issue with repeating the VehicleID in tblAppointments.

Some points, though.
In general, it is much preferred to base your forms on a query, not on the table.
Your appointment form would be much easier to use if you had combo boxes so that selections were made from a list.
 

Users who are viewing this thread

Back
Top Bottom