Re: Key-Startup Question

From: David Elliott <dae_at_pencom.com>
Date: 1 Jun 92 22:20:10 GMT
Message-ID: <1992Jun1.222010.26729_at_pencom.com>


In article <1992May31.184743.4977_at_deepthought.uucp> nasris_at_deepthought.uucp (Neil Greene) writes:
> I have a form which is used only for doing database searches. I would like
> this form to start in "ENTER QUERY" mode so the user does not have to hit
> his/her ENTER-QUERY key. I simply set a KEY-STARTUP trigger at the form
 level
> to enter_query.
>
> The user now enters the search specifications in the database fields and
 presses
> the EXECUTE-QUERY key. Now, if the user presses their NEXT/PREVIOUS BLOCK
> keys, the form displays no records until the EXECUTE-QUERY key is pressed
 again.
>
> I have looked at the looked at the default procedures SQL*Forms has created
 and
> the query_XXX_details procedure is calling execute_query.
>
> Should I try to accomplish the above another way, or is their something I am
> missing right now to finish this procedure?
>

I had a client that needed a form that let him type in the ssn of an employee, and the form was supposed to automatically do a lookup of that employee ssn. If it wasn't found, the user would then be told that this employee didn't exist and would simply enter data for the "new" employee. This was pretty tricky to implement and I did it several months ago and I hope I can make this understandable.

First, I set up a small block called control, not associated with a base table, into which the user entered the ssn. This block has one block-level trigger - key-nxtblk which does a next_block and an execute_query.

Control has a field called employee_code into which the user enters a 9 character ssn. This field has AUTOSKIP = ON and two triggers: ON-NEW-FIELD-INSTANCE which consists of clear_block(NO_COMMIT); and KEY-NXTFLD which consists of next_block and execute_query.

After employee_code, there is another field called dummy, which is of type CHAR with a DISPLAY_LENGTH of 1. Also ECHO, UPDATE, and QUERY were OFF. dummy has one trigger, ON-NEW-FIELD-INSTANCE, which consists of next_block and execute_query.

The next block, emps, is where the actual employee data appears. It has a KEY-PRVFLD trigger, which consists of previous_block; This caused control to go back to 'control', where the user enters the employee ssn.

I've left out some other details, but I think this is enough to give you an idea of how I did it. Hope this helps.

--
---

David Elliott
Pencom Software
Austin, Texas
dae_at_pencom.com
Received on Tue Jun 02 1992 - 00:20:10 CEST

Original text of this message