Access Unique values with validation

Copper Contributor

I am trying to set it up so that the ID is unique for a corresponding month (i.e the database won't take the same id for a given month) the values in green should be allowed but the value in red should not be allowed to enter. 20220818_101526.jpg

2 Replies


Create an (one) unique index on the 2 fields. 


Actually, the resolution to this problem is very straightforward, as suggested by XPS35. 


However, this screenshot shows a table that is clearly not properly designed for a relational database. It is what is often called a "Spreadsheet Style" table. Such tables are often imported originally from Excel worksheets, in fact. Sometimes people who have Excel experience build tables like this, not realizing the reason why they are not appropriate in a relational database application.

Specifically, we can see a number of repeated columns, "xxx_Day", where xxx is Pay or OT or some other type of day. This creates numerous problems, many of which you'll quickly encounter.


If this is a new relational database application you are just starting on, fix this design problem now, please. 


Here is a link to a blog site with several excellent articles describing the design problem in detail and explaining how to correct it. I've linked to one, but please don't waste further time on this problematic table design until you've studied all of the related articles at that site.