B
Bruce
This should be simple, but a search of Help and of
newsgroups has shown me that it is not. I want to prevent
a duplicate entry in the DocumentNumber field (which is
not the PK). I know that I can set the table to Index (no
duplicates), but the error message shows up only when
moving from the record, and is not useful in any case, as
it does not tell the user just what needs to change. I
would like an error message to show up after leaving the
DocumentNumber field if the number entered there is
already being used. I have seen suggestions for the
Before Update event that involve If statements combined
with Dcount; Dlookup in various combinations; and other
code that runs on for fifteen lines or more, but so far
everything I have tried has produced an error message.
By the way, I do not regard compound field PK as one of
the options (it was among the suggestions).
newsgroups has shown me that it is not. I want to prevent
a duplicate entry in the DocumentNumber field (which is
not the PK). I know that I can set the table to Index (no
duplicates), but the error message shows up only when
moving from the record, and is not useful in any case, as
it does not tell the user just what needs to change. I
would like an error message to show up after leaving the
DocumentNumber field if the number entered there is
already being used. I have seen suggestions for the
Before Update event that involve If statements combined
with Dcount; Dlookup in various combinations; and other
code that runs on for fifteen lines or more, but so far
everything I have tried has produced an error message.
By the way, I do not regard compound field PK as one of
the options (it was among the suggestions).