Integrity in my tables

Copper Contributor

I am making a database for a veterinary clinic. when entering data into the appointments table, I need it to limit what can be entered for PetID based on CustomerID so that pets aren't listed with the wrong owners. Any Suggestions?

2a3a6b82-9873-4f10-9321-42021a1fc460.png

Pets table.png

1 Reply

@Seanarm1234 There is no need to store the customerID in the appointment table. If you just store the petID, you can find the customer through the pet table. You can show the customer on the appointment form and use that to find a pet for a new appointment. Search for "cascading comboboxes" to find examples.

 

One more point. What if a customer wants to make an appointment for two or more pets?