Re: preventing 2 rows with same "flag" set

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: Wed, 11 Oct 2000 20:03:57 -0700
Message-ID: <suaa84qd61safb_at_corp.supernews.com>


"Eric Givler" <egivler_at_flash.net> wrote in message news:CRZE5.1506$ln6.174917_at_news.flash.net...
> Ok...
>
> I opened the form, put the code in the when-checkbox-changed, and then ran
> it. I queried on a user
> with 2 locations. I set the checkbox on each row and then committed and now
> have two flags. Forms
> doesn't post the data between record movements on a single block form, so it
> doesn't SEE the other flag
> as set in the database when the trigger fires.

Ah - that's true. That code that I gave you would only do it if there was a record in the database.

You would have to do additional coding, such as on PRE-INSERT and/or PRE-UPDATE, where you do the validation again.

> I wasn't sure why the code you posted didn't check to see that the user has
> actually SET THE
> FLAG. It just checks for a flag already set.

Right - didn't think of it in a situation where the user would have tried to do this to multiple records in the form.

-Matt Received on Thu Oct 12 2000 - 05:03:57 CEST

Original text of this message