Re: Preventing Duplicates in BeforePost event.



Never mind, I realized you ment the state of the dataset not the record. I
think I got it now, thanks for the hint.

"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:704rd1993hf8j3jjojl8tqqp6pnou3go4u@xxxxxxxxxx

>This worked great while the user was entering the values. However, if at a
>later time in the code a record had to be modified, the BeforePost event
>would fire and then I would get the message about a dupicate record. This
>is because the cloned dataset now had all entered record and whenever the
>BeforePost event fires it aready has the values.
You should be able to check the STATUS property. If it is dsInsert use
your
code and if it is DSUpdate you need to check for more than one record with
your
key value

>
>Does anyone else know of a better way to prevent duplicates?

--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx


.



Relevant Pages

  • Re: Preventing Duplicates in BeforePost event.
    ... UpdateBatch is executed. ... Sorry to be a pain, but using my code can you give ... >BeforePost event fires it aready has the values. ...
    (borland.public.delphi.database.ado)
  • Re: Preventing Duplicates in BeforePost event.
    ... >This worked great while the user was entering the values. ... >BeforePost event fires it aready has the values. ... code and if it is DSUpdate you need to check for more than one record with your ...
    (borland.public.delphi.database.ado)