DEFINE VARIABLE cOption AS CHARACTER NO-UNDO.
DEFINE TEMP-TABLE ttCustomers NO-UNDO
FIELD iCustNum AS INTEGER LABEL "Cust #" FORMAT ">>9"
FIELD cCustName AS CHARACTER LABEL "Cust Name" FORMAT "X(20)"
FIELD cOptions AS CHAR LABEL "Option"
INDEX idxCustNum IS PRIMARY UNIQUE iCustNum
INDEX idxOptions IS UNIQUE cOptions iCustNum.
DEFINE QUERY q1 FOR ttCustomers SCROLLING.
DEFINE BROWSE b1 QUERY q1
DISPLAY ttCustomers.iCustNum
ttCustomers.cCustName
ttCustomers.cOptions WIDTH 14 VIEW-AS COMBO-BOX INNER-LINES 4 DROP-DOWN-LIST
ENABLE ttCustomers.cOptions
WITH 4 DOWN NO-ASSIGN SEPARATORS.
DEFINE FRAME f1 b1
WITH SIDE-LABELS AT ROW 2 COLUMN 2.
ON VALUE-CHANGED OF ttCustomers.cOptions IN BROWSE b1 DO:
cOption = SELF:SCREEN-VALUE.
OPEN QUERY q1 FOR EACH ttCustomers WHERE ttCustomers.cOptions = cOption.
APPLY "ENTRY" TO ttCustomers.cOptions IN BROWSE b1.
END.
ttCustomers.cOptions:LIST-ITEMS IN BROWSE b1 = "EACH,CASE,BOX,DOZ".
CREATE ttCustomers.
ASSIGN ttCustomers.iCustNum = 1
ttCustomers.cCustName = "Customer Number 1"
ttCustomers.cOptions = "CASE".
CREATE ttCustomers.
ASSIGN ttCustomers.iCustNum = 2
ttCustomers.cCustName = "Customer Number 2"
ttCustomers.cOptions = "DOZ".
CREATE ttCustomers.
ASSIGN ttCustomers.iCustNum = 3
ttCustomers.cCustName = "Customer Number 3"
ttCustomers.cOptions = "EACH".
CREATE ttCustomers.
ASSIGN ttCustomers.iCustNum = 4
ttCustomers.cCustName = "Customer Number 4"
ttCustomers.cOptions = "BOX".
OPEN QUERY q1 FOR EACH ttCustomers.
ENABLE b1 WITH FRAME f1.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.