4GL Browser question

Hi all,

A question for you clever 4GL gurus out there...

I'm trying to write a small program that incorporates a Browse widget, but I have a specific problems with it. When I run my prog, it displays the Browse and its data, but then quick as a flash it blanks out the data leaving the Browse empty. The Browse gets its data from a query on a Temp-Table that the prog builds. This all happens within an event trigger block in the prog. Would someone have a quick look at the following exerpt of code to see if something stands out as fundamentally wrong?

Thank you very much to anyone who has a look for me :-) Here's the excerpt...




ON RETURN OF txtJob
OR RETURN OF numQTY
DO:

DEFINE VARIABLE lReturnValue AS LOGICAL.

EMPTY TEMP-TABLE JobInv.

/* Perform the initial query to find posted invoices for the specified job (any qty at
this point).
Note: this query was acquired from and verified by the Vantage 'Export Utility' */

FOR EACH JobHead WHERE JobHead.Company = "Ripley"
AND JobHead.JobNum = txtJob:SCREEN-VALUE NO-LOCK,
EACH ShipDtl WHERE ShipDtl.Company = JobHead.Company
AND ShipDtl.JobNum = JobHead.JobNum NO-LOCK,
EACH InvcDtl WHERE InvcDtl.Company = ShipDtl.Company
AND InvcDtl.PackNum = ShipDtl.PackNum
AND InvcDtl.PackLine = ShipDtl.PackLine NO-LOCK,
EACH InvcHead WHERE InvcHead.Company = InvcDtl.Company
AND InvcHead.InvoiceNum = InvcDtl.InvoiceNum
AND InvcHead.Posted = yes NO-LOCK
BY InvcHead.InvoiceNum DESCENDING.

CREATE JobInv. /* Create a row in JobInv, defined previously */


JobInv.JobNum = JobHead.JobNum.
JobInv.Order = STRING(InvcDtl.OrderNum) + "/"
+ STRING(InvcDtl.OrderLine) + "/"
+ STRING(InvcDtl.OrderRelNum).
JobInv.InvoiceNum = InvcDtl.InvoiceNum.
JobInv.InvoiceQty = InvcDtl.OurShipQty.
JobInv.InvoiceDate = InvcHead.InvoiceDate.
JobInv.PackNum = ShipDtl.PackNum.
JobInv.PartNum = InvcDtl.PartNum.

END.

IF JobInv.JobNum = ""
THEN DO:
MESSAGE "There are no posted invoices for job " + txtJob:SCREEN-VALUE.
END.

DEFINE QUERY Brwse-Query FOR JobInv SCROLLING.

DEFINE BROWSE Brwse
QUERY Brwse-Query
DISPLAY JobInv
WITH SIZE 110 BY 5
EXPANDABLE.

DEFINE FRAME Brwse-Frame
Brwse
WITH SIDE-LABELS
AT ROW 1 COL 30
SIZE 110 BY 5
NO-BOX
FONT 2.

OPEN QUERY Brwse-Query FOR EACH JobInv NO-LOCK.

ENABLE ALL WITH FRAME Brwse-Frame.

lReturnValue = winRB:LOAD-MOUSE-POINTER("ARROW").

APPLY "BACK-TAB":U TO numQTY.

END.




Thanks again!

++ Andy Watts

++ Ripley Engineering Ltd
++ Tel: 01256-473940
++ Fax: 01256-479991
++ mailto: andy@...