do not duplicate date values in form

J

JK

I have a table called weeklysummary. It contains a field called EmployeeID
and WeekEnding. WeekEnding is a date field. I want to prevent a user from
entering a duplicate date based on Employee. There will be duplicate dates in
the table, one for each Salesperson but again, I must prevent duplicate dates
by Salesperson.

I found this:
Store the identifier in two fields: one for the main number and one for the
suffix. In table design view, click on View > Indexes to open the Indexes
window. Create a multi-field index that is unique on the two fields taken
together. To do this, assign an Index Name in the left-hand column. Pick the
first field in the Field Name column. Then pick the suffix field in the very
next row, *without* assigning an Index Name. In the lower portion, select Yes
for the middle choice that reads Unique.

When I try to configure this suggestion, I get an error message that say's
"the changes you requested could not be made becuase it would create
duplicate values in the index, primary key or relationship."

I was wondering if someone out there could help me out with this. Maybe
there is another way?

Thx.
 
K

KARL DEWEY

You need to run a totals query that has EmployeeID and WeekEnding fields as
Group By and then the EmployeeID as Count. Set criteria for the count as
1 to find any duplicates. Fix the duplicates and then set your unique
index.
 

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

Top