Subject Re: [firebird-support] Record duplication
Author Robin Davis
Hi Helen,

Helen Borrie wrote:
> At 08:13 PM 30/05/2006, you wrote:
>> Is there
>> a tweak to the PK trigger I could use, or something else that doesn't
>> require techo-dependant but techno-dork-like users to DO anything?
> You don't say whether you're using a generator and a before insert
> trigger, but I hope so.
> Change the trigger to:
> if (new.PK_value is null or new.PK_value < 0) then
> new.PK_value = gen_id (MyGenerator, 1);
> Then have them just type any negative number in the PK field.
> This is also safe - avoids the duplication AND steps the generator.
Bless you for that simple but effective solution! The only problem now
is that the newly inserted record comes up with all fields marked as
deleted until you close the form and reopen it - at which point all is
as it should be. Any thoughts - apart from getting them to ditch Access? ;-)

Rob Davis