Novice,
Thanks for the further explanation. I am now starting to piece
together a picture of what you are doing.
Just by way of clarification of jargon, a table in Access can only
ever have one primary key. That primary key can be comprised of more
than one field, i.e. a composite key, which sounds like what you have
done. This is ok, but for the record, I would personally never design
it like this.
I already told you in my earlier reply a way to check for duplicate
dates. It assumes you will be entering the date into the date field
on a new record on the subform. Did you try my suggestion with a new
record? Also, you will need to type the date in... I don't know
whether the Before Update event of the date control will occur if the
value is being entered via a date picker control. If you are entering
the date into the date field into an existing record, all you are
achieving is editing the date in the existing record, which is
obviously not what you want. The alternative, though I can't see it
would be any easier, is to put an *unbound* textbox, maybe in the
header section of the subform, where you can type in the date, and use
some code to react to whether the date is already used. Once again,
if you are using a date picker control, your code might need to be on
the date picker's event property, rather than the date control on your
form.
Hope that might get you closer, and also help you to specify further
what you really want to happen.
- Steve Schapel, Microsoft Access MVP