Re: Forms 6.0 - Item value getting Cleared!!

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au.no_junk_email>
Date: Thu, 16 Dec 1999 15:51:15 +1100
Message-ID: <839rbj$iis$1_at_gossamer.itmel.bhp.com.au>


Eric,

You can't load a base table item with a value, and then query on that value, without the Form being in Query mode. At the time you assign a value to ID, the Form is in Normal mode, hence this is interpreted as inserting a record. Execute_Query issues an automatic Clear_Form which validates the form and detects there is a record with a status of 'insert'.

To assign a value to your ID, use the Pre-Query trigger on the Master block, and ensure that the Master-Detail Relation is based on the ID. Perhaps the original problem with the item clearing is because the Item's Query Allowed property is False. Either that, or it's not a base table item, in which case you can re-assign it in a Post-Query trigger. I would say that you had the Pre-Query defined against the Detail block when you observed the trigger sequence, since the Master's Pre-Query fires as the first step of query execution. The On-Populate fires afterwards.

You won't need to set Insert_Allowed = True on the Detail block once you set the ID correctly.

Eric Raskin wrote in message ...
>Back again, with a little more resolved. I was querying the wrong block!!
>Instead of querying the MASTER block and allowing it to automatically
>populate the DETAIL blocks, I now query the DETAIL block directly, before
>returning to the MASTER block. This stops the "Save Record" message for
the
>MASTER block.
>
>Now, I'm getting "Do you Want to Save Changes" for the DETAIL block!! I
>really want the DETAIL block to be Query only, but I get FRM-41051 if I
turn
>off the "Insert Allowed" property. So, I have to allow inserts in a
>display-only DETAIL block. This is really confusing!!
>
>Anyone tell me what I've done wrong now?
>
>Eric
>
Received on Thu Dec 16 1999 - 05:51:15 CET

Original text of this message