That's why I suggested adding a third field to both the table and the index
(by which I mean the primary key). If you add a Yes/No field, the table
could now include two records with the same Reg No. and Cert Name, provided
that one of those records had a value of True in the Yes/No field and the
other had a value of False. But I do see a difficulty there, in that it is
not impossible for the same certificate to be cancelled more than once.
The fundamental problem, as I see it, is that the database design says that
the same certificate can not be issued to the same student more than once,
but that is not the reality of the situation being modelled. The same
certificate *can* be issued to the same student more than once, provided all
previous instances of that certificate issued to that student have been
cancelled.
Off-hand, I can think of two possible solutions.
One would be to add the 'CertCancelled', Yes/No field that I suggested
earlier, but not to make it part of the primary key. The primary key might,
perhaps, be RegNo, CertName, and DateTimeIssued. This design would not
prevent the same certificate being issued to the same student more than
once, instead, code in the front-end application would handle that, checking
that no record existed with the same RegNo, CertName, and a value of False
in the CertCancelled field before allowing the addition of the new record.
The downside of this approach, of course, is that the validation would take
place at the application level rather than the database level.
The second possible solution would involve an additional table, say
'CertIssues'. The certificate can be issued as many times as necessary to
the same student, and each issue of a certificate is recorded in the
'CertIssues' table, but it remains the *same* certificate - the certificate
has been *issued* many times, but it has been *awarded* only once, if you
see what I mean. This is obviously a more complex design, but it more
closely models the real-world situation. The primary key of your existing
table would remain as it is, RegNo and CertName, as this table would contain
only one record for each certificate issued to that student. The multiple
'issuings' would be recorded instead in the 'CertIssues' table, with a
primary key on RegNo, CertName, and DateTimeIssued, and a foreign key on
RegNo and CertName.
Even with the second design, though, I can't think of a way of imposing the
'only one record not cancelled' rule at the database level without triggers.
(I'm assuming we're dealing with a JET, MDB database here, and not with an
Access front-end to a server database such as SQL Server, so triggers are
not available.) Unless someone else can suggest a way to do this at the
database level, I think you may need to depend on application-level code for
that.