"Aladino" <borgobello-NO (AT) SPAM-alice (DOT) it> wrote
Quote:
Ho can I verify that a value is existing in combination with another
field value? I think I'll explain better with an example:
field 1 -> year (four digit)
field 2 -> code (number between 0001 and 9999)
I want that the same year I can't use the seme code, but every year the
code should leave again from 1.
With the two fields I creatre an 8 digit serial number, that is year &
code, that must be unique, but I won't input serial number and calculate
the other two fields. |
To do this you will need to define a Relationship, within the same Table,
based on the Year field to group together all records of the same Year.
e.g.
rel_SameYear Match records in TableA with records in TableA
When Year = TableA::Year
From this you can then create the Code field which finds the maximum* value
of the existing Codes for the same Year and add 1 to that.
e.g.
Code Number
Auto-enter by Calculation
= Max(rel_SameYear::Field1) + 1
* Note: You can't use the Count function here because that would cause
duplicate codes when a Related Record is deleted.
Helpfull Harry

)