Search condition

JoeAcess

Jones
Local time
Today, 14:07
Joined
Dec 9, 2008
Messages
25
Hello everybody


I am a newbie to Access. I creating a form called appointments. There are appointment slots between 1 - 10 for a particular day. As i enter the data if i put slot number 2, i need the computer to respond to me if the slot is free for that particular day or already entered. If free i want the available field to go green else red if taken.


Thank you
 
Probably a matter of setting the table's primary key in the table's Design View. When you mark a column as "Primary key" you are telling Access, "Don't allow any values in this column to be repeated."

Sometimes two or more columns will form the primary key. For instance

MemberId, SlotNumber

This would mean that a given member (say MemberID 100) could have 10 slot numbers

MemberId.....SlotNumber
100..............1
100..............2..(etc)

but Access would not allow:

MemberId.....SlotNumber
100..............5
100..............5

as it would be a violation of the primary key.
 
The appointment is given to particular person for a particular day at a particular time slot. I can't base it on a primary key. Because the same time slots come for the next day.
 
The appointment is given to particular person for a particular day at a particular time slot. I can't base it on a primary key. Because the same time slots come for the next day.
You haven't yet convinced me it won't work. As I said, the primary key can be multicolumn. You might want to consider this:

EmployeeId.....SlotNumber.......ApptDate

This three-column primary key would prevent a particular person from having dup appointment slots on the same day.
 

Users who are viewing this thread

Back
Top Bottom