>Hello,
>
>A discussion that comes back regularly in our shop is the following:
>In a data entry form for widgets you have to enter a description and a number only. No two widgets can have the same number. When you save the entry the program must check if the widget number does not already exist.
>What would be the best code for this ? (there are two situations, 1. it is a new entry, 2. it is an edit of an existing entry).
>Anybody has wisdom here ?
>
>Thanks,
One of the quickest ways is to add a CANDIDATE key on the number field in the table. Then trap for a candidate key violation.
Insanity: Doing the same thing over and over and expecting different results.