Question regarding fields in a datasheet containing the same value

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hello,

A piece of the database that I created is used to schedule
appointments. I have a form and then a subform detailing the day's
events. The subform is defaulted to datasheet view. The datasheet has
these fields: start_time, end_time, appointment, & date_scheduled. The
problem that I am having though is this: It is necessary for my boss
to have double entries in any given days schedule. I would like to add
the ability so if there are two entries that have the same start_time
the times in that field will turn red. I attempted doing this through
conditional formatting but had no luck. I'm also thinking just some IF
THEN statements might do the trick in the on_current event. Thank you
in advance for any help.

Dan.
 
Use the function DCount() with a conditional formatting expression:

DCount("*","TableOrQuery","[Field1]=" & [Field1])>1

You will have to enclose the parameter in quotes or # for text and dates.
You can refer to other fields within the criteria expression, e.g. [Date]=...
And [Time]=...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top