A dynamic Browser help

dayv2005

Member
Im using a drop down combo box with a browser. what it does is a drop down of ppl and once i click on another person from the list i was wondering how i would make it so that the browser automatically just shows what job that person is working on.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
with the sports2000.db

Code:
/* customer browse, salesrep combo-box and frame container definition */

define query qCustomer

    for customer scrolling.

define browse bCustomer

    query qCustomer

    display
        customer.custnum
        customer.name
        customer.city
    with 10 down.

define var cSalesRep like salesrep.salesrep no-undo.

form
    cSalesRep   format "x(28)"
                view-as combo-box
                    inner-lines 7 sort
    skip(1)
    bCustomer

with frame fMain side-labels three-d.



/* salesrep combo-box added behavior */

on "value-changed" of cSalesRep in frame fMain do:

    /* opens the browse query for the current salesrep */

    open query qCustomer

        for each  customer
            where customer.salesrep = cSalesRep:input-value in frame fMain
            no-lock.

end. /* value-changed of salesrep */




/* populate salesrep combo-box */

do with frame fMain:
                                 
    assign
        cSalesRep:list-item-pairs   = ?
        cSalesRep:delimiter         = chr(1).

    for each salesrep no-lock:

        cSalesRep:add-last(
            salesrep.repname + " / " + salesrep.region,
                salesrep.salesrep ).

    end. /* each salesrep */

    cSalesRep:screen-value = cSalesRep:entry(1).
    apply "value-changed" to cSalesRep.

end. /* with fMain */



enable all with frame fMain.

wait-for window-close of current-window.

hth
 
Top