Re: Forms Builder 6.0: How to insert default values in query mode?

From: Rick E. <rickest_at_deleteme.yahooooo.com>
Date: Fri, 11 Jan 2002 15:17:18 -0700
Message-ID: <BuJ%7.305$kb6.113451_at_newsfeed.slurp.net>


Ok, thanks to everyone's help I think I've got this one wrapped up. It's not very pretty insomuch as a global is required, but it gets the job done:

In PRE-FORM:

    :GLOBAL.bInitQuery := 0;

In PRE-QUERY:

    :GLOBAL.bInitQuery := 0;

In WHEN-NEW-ITEM-INSTANCE:

if (:system.mode = 'ENTER-QUERY' and :GLOBAL.bInitQuery = 0 ) then
    :GLOBAL.bInitQuery := 1;
    :formName.firstField := 'my default data';
    Go_Item( 'formName.secondField' ); -- set focus to the next field end if;

[Quoted] [Quoted] The global var makes sure that the when-new-item-instance trigger fires only [Quoted] once after entering query modem. Hope someone else can use this.

Regards,
Rick

"Rick E." <rickest_at_deleteme.yahooooo.com> wrote in message news:WMI%7.281$kb6.104496_at_newsfeed.slurp.net...
> I spoke a little too soon. :-)
>
> It does put a default value in the appropriate field(s) but everytime you
> change focus to a new item on the form this trigger fires again and puts
all
> the default values back in. If you only have one default field, then this
> would work as long as the user enters data into that field last and
executes
> the query without navigating to a different field, but for multiple fields
> with default values, this doesn't really create "default" data so much as
it
> creates "fixed" data.
>
> Anyway, I'll keep playing with it. I do appreciate the tips everyone has
> offered.
> - Rick
Received on Fri Jan 11 2002 - 23:17:18 CET

Original text of this message