I am trying to prevent a user entering duplicates of date and time in an appointments table for the same doctor..how do I do this?
I am trying to prevent a user entering duplicates of date and time in an appointments table for the same doctor..how do I do this?
Review unique composite index.
Orange's advice is technically true and there are other alternatives. It depends on the style of user interface you are developing.
One approach is to use combo boxes (drop downs) for the time slots - and with the underlying query of the combo box only offer / display those that are available.
Another approach is to do a Dlookup after the entry and then pop up a message.
Here's another possible method. See this free video tutorial showing how to have 2 listboxes, and moving between them.
Could be used as IsAvail, IsBooked