>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,
We have two modes for our forms: Add and Edit.
If you are Add mode the candidate key is checked before a save is performed. If the check fails, a suitable error message is displayed.
If you are in Edit mode and the seek/indexseek/locate fails to find the record you are currently editing (via record number) then another suitable message is displayed.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao