compound key

theuman

New member
Local time
Yesterday, 22:51
Joined
Mar 10, 2007
Messages
7
hi

I am creating a table that will be used for bookings of a court.

I would like to creat a compound key that will be a mixture of the date and time the court is booked for.

This will make it impossible to book the same court at the same time of the same date.

How can I do that?

this is done in access

I have three tables and one form

there is a drop down menu which says the table to insert data to

there is a text box for date and another one for time

What I am hoping to do is the drop menu selects the table and inserts a value in the id key field as a combination of the values of date and time


Thanks
 
If you really need a compound key, you go into the table in design view and select each column by holding your Ctl key down and then click on the key icon on the toolbar.
 
what i mean is to have a coloumn called ID which has the values of date and time which will be entered by a textbox in a form
 
No, no, no - don't do that. You will kill yourself trying to make that work. Just use two columns (if you want to display them together you can, but use two columns and set the key on them as the compound like I mentioned).
 
OK how would i search them if i want to see if that specific time (date+time) is booked?
 

Users who are viewing this thread

Back
Top Bottom