Only one uniq record with specific Employee- and date-values

  • Thread starter Thread starter BrunoKP
  • Start date Start date
B

BrunoKP

I have a table with an EmployeeID-field and a date-field. Before I add a new
record I want to check that there is no record with that specific EmployeeID
number and specific date already, because I want only one record with that
specific combination of the EmployeeID number the date.
Which function do you suggest?
I tried with FindFirst, but with that I can only test for one field.
Yes I am not much experienced with Access/VBA.
 
Why not go into table design an create a two-field index and set to unique?
 
Good idea, which I have followed. But still I have to check for unique-ness
before I add a new record. I found another answer by Douglas J. Steele:
(...And ContactDate = " & Format(SalesForce.Fields("Date"),
"\#yyyy\-mm\-dd\#") & " And ContactType= '" & SalesForce.Fields("Type") & "'")
about how to check for multible criterias in FindFirst, included a date. In
that way the whole problem has been solved.

"KARL DEWEY" skrev:
 

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