home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April B / Pcwk4b98.iso / Borland / Dbase50w / SAMPLES1.PAK / CUSTOMER.WFM < prev    next >
Text File  |  1994-08-02  |  22KB  |  646 lines

  1. *******************************************************************************
  2. *  PROGRAM:      Customer.wfm
  3. *
  4. *  WRITTEN BY:   Borland Samples Group
  5. *
  6. *  DATE:         12/93
  7. *
  8. *  UPDATED:      7/94
  9. *
  10. *  REVISION:     $Revision:   1.100  $
  11. *
  12. *  VERSION:      dBASE FOR WINDOWS 5.0
  13. *
  14. *  DESCRIPTION:  This program displays information about the customers of a
  15. *                company.  It contains entryfields and radio buttons with
  16. *                various customer information.  A browse object displays
  17. *                orders made by this customer.  To add, delete, and search
  18. *                for customers, a menu (Customer.mnu) is used.  This form
  19. *                also has custom buttons (from Buttons.cc) to allow traversing
  20. *                through customers.  Information can be viewed in either
  21. *                View mode or in Edit mode, which is toggled in the menu.
  22. *
  23. *  PARAMETERS:   None
  24. *
  25. *  CALLS:        Customer.mnu         (Menu file)
  26. *                Buttons.cc           (Custom controls)
  27. *                Orders.wfm           (Orders detail form)
  28. *                Customer.qbe         (View of tables)
  29. *
  30. *  USAGE:        DO Customer.wfm      && Note that you can also DO Orders.wfm
  31. *
  32. *******************************************************************************
  33. #include <Messdlg.h>
  34. shell(.f.,.t.)
  35. create session
  36. set talk off
  37. set ldCheck off                        && To avoid language driver conflicts
  38.  
  39. ** END HEADER -- do not remove this line*
  40. * Generated on 07/06/94
  41. *
  42. local f
  43. f = NEW CUSTOMERFORM()
  44. f.Open()
  45.  
  46. CLASS CUSTOMERFORM OF FORM
  47.    Set Procedure to BUTTONS.CC Additive
  48.    this.OnClose = CLASS::ONCLOSE
  49.    this.MenuFile = "CUSTOMER.MNU"
  50.    this.View = "CUSTOMER.QBE"
  51.    this.Top =          0.00
  52.    this.Width =         88.40
  53.    this.Height =         21.51
  54.    this.Left =          1.53
  55.    this.Text = "Customer -- View Mode"
  56.    this.MousePointer =          1
  57.    this.Maximize = .F.
  58.    this.HelpId = ""
  59.    this.Minimize = .F.
  60.    this.EscExit = .F.
  61.    this.HelpFile = ""
  62.  
  63.    DEFINE PREVBUTTON PREVCUSTBUTTON OF THIS;
  64.        PROPERTY;
  65.          OnClick CLASS::PREVIOUS,;
  66.          Top         19.62,;
  67.          Width         14.11,;
  68.          Default .T.,;
  69.          Height          1.50,;
  70.          Left          1.35,;
  71.          Group .T.
  72.  
  73.    DEFINE NEXTBUTTON NEXTCUSTBUTTON OF THIS;
  74.        PROPERTY;
  75.          OnClick CLASS::NEXT,;
  76.          Top         19.62,;
  77.          Width         14.11,;
  78.          Height          1.50,;
  79.          Left         16.28,;
  80.          Group .F.
  81.  
  82.  
  83.    DEFINE PUSHBUTTON FIRSTCUSTBUTTON OF THIS;
  84.        PROPERTY;
  85.          OnClick {;form.CheckCommit(form.inEditMode);go top},;
  86.          Top         19.62,;
  87.          Width         14.11,;
  88.          Text "F&irst",;
  89.          ColorNormal "N/W",;
  90.          Height          1.50,;
  91.          Left         31.08,;
  92.          StatusMessage "Go to the first record.",;
  93.          Group .F.
  94.  
  95.  
  96.    DEFINE PUSHBUTTON LASTCUSTBUTTON OF THIS;
  97.        PROPERTY;
  98.          OnClick {;form.CheckCommit(form.inEditMode);go bottom},;
  99.          Top         19.62,;
  100.          Width         14.11,;
  101.          Text "&Last",;
  102.          ColorNormal "N/W",;
  103.          Height          1.50,;
  104.          Left         45.95,;
  105.          StatusMessage "Go to the last customer.",;
  106.          Group .F.
  107.  
  108.    DEFINE RECTANGLE NAMEPHONEBOX OF THIS;
  109.        PROPERTY;
  110.          Top          0.26,;
  111.          Width         85.85,;
  112.          Text "Customer Info",;
  113.          ColorNormal "N/W",;
  114.          Border .T.,;
  115.          Height         18.56,;
  116.          Left          1.35
  117.  
  118.    DEFINE TEXT NAMETEXT OF THIS;
  119.        PROPERTY;
  120.          Top          1.32,;
  121.          Width          10.81,;
  122.          Text "N&ame:",;
  123.          ColorNormal "B/W",;
  124.          Border .F.,;
  125.          Alignment          5,;
  126.          Height          1.32,;
  127.          Left          2.03
  128.  
  129.    DEFINE ENTRYFIELD NAMEENTRY OF THIS;
  130.        PROPERTY;
  131.          Top          1.32,;
  132.          Width         54.06,;
  133.          OnChange CLASS::CHANGESMADE,;
  134.          Border .T.,;
  135.          Enabled .F.,;
  136.          ColorNormal "N/W",;
  137.          ColorHighLight "B+/W*",;
  138.          Height          1.32,;
  139.          DataLink "CUSTOMER->NAME",;
  140.          Left         13.52
  141.  
  142.    DEFINE TEXT CUSTNOTEXT OF THIS;
  143.        PROPERTY;
  144.          Top          1.32,;
  145.          Width         13.52,;
  146.          Text "Customer #:",;
  147.          ColorNormal "B/W",;
  148.          Border .F.,;
  149.          Alignment          3,;
  150.          Height          1.32,;
  151.          Left         70.28
  152.  
  153.    DEFINE ENTRYFIELD CUSTNOENTRY OF THIS;
  154.        PROPERTY;
  155.          Top          2.66,;
  156.          Width          11.49,;
  157.          OnChange CLASS::CHANGESMADE,;
  158.          Border .T.,;
  159.          Enabled .F.,;
  160.          ColorNormal "N/W",;
  161.          ColorHighLight "B+/W*",;
  162.          Height          1.32,;
  163.          DataLink "CUSTOMER_N",;
  164.          Left         70.28
  165.  
  166.    DEFINE TEXT STREETTEXT OF THIS;
  167.        PROPERTY;
  168.          Top          2.66,;
  169.          Width          10.81,;
  170.          Text "&Street:",;
  171.          ColorNormal "B/W",;
  172.          Border .F.,;
  173.          Alignment          5,;
  174.          Height          1.32,;
  175.          Left          2.03
  176.  
  177.    DEFINE ENTRYFIELD STREETENTRY OF THIS;
  178.        PROPERTY;
  179.          Top          2.66,;
  180.          Width         54.06,;
  181.          OnChange CLASS::CHANGESMADE,;
  182.          Border .T.,;
  183.          Enabled .F.,;
  184.          ColorNormal "N/W",;
  185.          ColorHighLight "B+/W*",;
  186.          Height          1.32,;
  187.          DataLink "STREET",;
  188.          Left         13.52
  189.  
  190.    DEFINE TEXT CITYTEXT OF THIS;
  191.        PROPERTY;
  192.          Top          3.98,;
  193.          Width          10.81,;
  194.          Text "Cit&y:",;
  195.          ColorNormal "B/W",;
  196.          Border .F.,;
  197.          Alignment          5,;
  198.          Height          1.32,;
  199.          Left          2.03
  200.  
  201.    DEFINE ENTRYFIELD CITYENTRY OF THIS;
  202.        PROPERTY;
  203.          Top          3.98,;
  204.          Width         22.30,;
  205.          OnChange CLASS::CHANGESMADE,;
  206.          Border .T.,;
  207.          Enabled .F.,;
  208.          ColorNormal "N/W",;
  209.          ColorHighLight "B+/W*",;
  210.          Height          1.32,;
  211.          DataLink "CITY",;
  212.          Left         13.52
  213.  
  214.    DEFINE TEXT STATETEXT OF THIS;
  215.        PROPERTY;
  216.          Top          3.98,;
  217.          Width         16.22,;
  218.          Text "State/Pro&vince:",;
  219.          ColorNormal "B/W",;
  220.          Border .F.,;
  221.          Alignment          5,;
  222.          Height          1.32,;
  223.          Left         36.49
  224.  
  225.    DEFINE ENTRYFIELD STATEENTRY OF THIS;
  226.        PROPERTY;
  227.          Top          3.98,;
  228.          Width         14.20,;
  229.          OnChange CLASS::CHANGESMADE,;
  230.          Border .T.,;
  231.          Enabled .F.,;
  232.          ColorNormal "N/W",;
  233.          ColorHighLight "B+/W*",;
  234.          Height          1.32,;
  235.          DataLink "STATE_PROV",;
  236.          Left         53.39
  237.  
  238.    DEFINE TEXT ZIPTEXT OF THIS;
  239.        PROPERTY;
  240.          Top          5.30,;
  241.          Width          10.81,;
  242.          Text "&Zip Code:",;
  243.          ColorNormal "B/W",;
  244.          Border .F.,;
  245.          Alignment          5,;
  246.          Height          1.32,;
  247.          Left          2.03
  248.  
  249.    DEFINE ENTRYFIELD ZIPENTRY OF THIS;
  250.        PROPERTY;
  251.          Top          5.30,;
  252.          Width         22.30,;
  253.          OnChange CLASS::CHANGESMADE,;
  254.          Border .T.,;
  255.          Enabled .F.,;
  256.          ColorNormal "N/W",;
  257.          ColorHighLight "B+/W*",;
  258.          Height          1.32,;
  259.          DataLink "ZIP_POSTAL",;
  260.          Left         13.52
  261.  
  262.    DEFINE TEXT COUNTRYTEXT OF THIS;
  263.        PROPERTY;
  264.          Top          5.30,;
  265.          Width         14.87,;
  266.          Text "Count&ry:",;
  267.          ColorNormal "B/W",;
  268.          Border .F.,;
  269.          Alignment          5,;
  270.          Height          1.32,;
  271.          Left         37.84
  272.  
  273.    DEFINE ENTRYFIELD COUNTRYENTRY OF THIS;
  274.        PROPERTY;
  275.          Top          5.30,;
  276.          Width         14.20,;
  277.          OnChange CLASS::CHANGESMADE,;
  278.          Border .T.,;
  279.          Enabled .F.,;
  280.          ColorNormal "N/W",;
  281.          ColorHighLight "B+/W*",;
  282.          Height          1.32,;
  283.          DataLink "COUNTRY",;
  284.          Left         53.39
  285.  
  286.    DEFINE TEXT PHONETEXT OF THIS;
  287.        PROPERTY;
  288.          Top          6.63,;
  289.          Width          10.81,;
  290.          Text "P&hone:",;
  291.          ColorNormal "B/W",;
  292.          Border .F.,;
  293.          Alignment          5,;
  294.          Height          1.32,;
  295.          Left          2.03
  296.  
  297.    DEFINE ENTRYFIELD PHONEENTRY OF THIS;
  298.        PROPERTY;
  299.          Top          6.63,;
  300.          Width         22.30,;
  301.          OnChange CLASS::CHANGESMADE,;
  302.          Border .T.,;
  303.          Enabled .F.,;
  304.          ColorNormal "N/W",;
  305.          ColorHighLight "B+/W*",;
  306.          Height          1.32,;
  307.          DataLink "PHONE",;
  308.          Left         13.52
  309.  
  310.    DEFINE TEXT ORDERSTEXT OF THIS;
  311.        PROPERTY;
  312.          Top          7.95,;
  313.          Width          10.81,;
  314.          Text "&Orders:",;
  315.          ColorNormal "B/W",;
  316.          Border .F.,;
  317.          Alignment          5,;
  318.          Height          1.32,;
  319.          Left          2.03
  320.  
  321.    DEFINE BROWSE CHILDBROWSE OF THIS;
  322.        PROPERTY;
  323.          OnChange CLASS::CHANGESMADE,;
  324.          OnLeftDblClick CLASS::CHILDBROWSEDBLCLICK,;
  325.          OnNavigate CLASS::BROWSEONNAVIGATE,;
  326.          Top          8.22,;
  327.          Width         72.64,;
  328.          ColorNormal "N/W",;
  329.          Modify .F.,;
  330.          ShowRecNo .F.,;
  331.          FontBold .F.,;
  332.          Alias "ORDERS",;
  333.          Fields "ORDERS->ORDER_NO\H='ORDER NO',ORDERS->TOTAL\9\P='9,999,999.99',ORDERS->SALE_DATE\H='SALE DATE',ORDERS->SHIP_DATE\H='SHIP DATE',ORDERS->AMT_PAID\H='AMT PAID'\P='9,999,999.99',ORDERS->TERMS\12",;
  334.          ShowDeleted .F.,;
  335.          TabStop .T.,;
  336.          Modify .F.,;
  337.          Follow .T.,;
  338.          Delete .F.,;
  339.          Toggle .T.,;
  340.          Append .F.,;
  341.          Height          5.57,;
  342.          Left         13.52
  343.  
  344.    DEFINE TEXT SIGNATURETEXT OF THIS;
  345.        PROPERTY;
  346.          Top         14.05,;
  347.          Width         20.27,;
  348.          Text "Signature:",;
  349.          ColorNormal "B/W",;
  350.          Border .F.,;
  351.          Alignment          3,;
  352.          Height          1.32,;
  353.          Left         57.44
  354.  
  355.    DEFINE IMAGE SIGNATUREIMAGE OF THIS;
  356.        PROPERTY;
  357.          Top         15.15,;
  358.          Width         28.38,;
  359.          DataSource "BINARY SIGNATURE",;
  360.          Height          2.53,;
  361.          Left         57.44
  362.  
  363.    DEFINE TEXT NOTESTEXT OF THIS;
  364.        PROPERTY;
  365.          Top         14.05,;
  366.          Width          10.81,;
  367.          Text "No&tes:",;
  368.          ColorNormal "B/W",;
  369.          Border .F.,;
  370.          Alignment          5,;
  371.          Height          1.32,;
  372.          Left          2.03
  373.  
  374.    DEFINE EDITOR NOTESEDITOR OF THIS;
  375.        PROPERTY;
  376.          Top         14.32,;
  377.          Width         43.25,;
  378.          ColorNormal "N/W",;
  379.          OnGotFocus {;if this.Modify;this.colorNormal = "B+/W*";endif},;
  380.          OnLostFocus {;if this.Modify;this.colorNormal = "N/W";endif},;
  381.          OnChange CLASS::CHANGESMADE,;
  382.          Border .T.,;
  383.          Modify .F.,;
  384.          Wrap .T.,;
  385.          Height          4.24,;
  386.          DataLink "CUSTOMER->NOTES",;
  387.          Left         13.52
  388.  
  389.    DEFINE IMAGE LOGOIMAGE OF THIS;
  390.        PROPERTY;
  391.          Top         18.89,;
  392.          Width         14.87,;
  393.          DataSource "FILE DIVESHOP.BMP",;
  394.          Height          2.83,;
  395.          Alignment   1,;
  396.          Left         71.63
  397.  
  398.    ****************************************************************************
  399.    procedure Open
  400.    ****************************************************************************
  401.    private custNoField, orderField
  402.  
  403.    if type("form.init") = "U"
  404.       form.init = .t.
  405.  
  406.       set skip to                        && Customer.qbe has set skip to orders
  407.       set exact off                      && Customer.qbe has set exact on
  408.  
  409.       set procedure to SampProc additive
  410.       set procedure to Orders.wfm additive
  411.  
  412.       *** Do calculations in other area, so form doesn't update on record moves
  413.       select select()
  414.       use customer again alias temp
  415.       custNoField = field(1)             && Field customer_n
  416.       set order to &custNoField          && Tag name is same as field name
  417.       go bottom
  418.       form.maxCustNo = &custNoField      && Max value for the key - used for
  419.                                          &&   creating new customers
  420.       use
  421.       select customer
  422.  
  423.       *** Other setup work
  424.       form.inEditMode  = .f.              && Indicate view/edit state
  425.       form.changesMade = .f.              && Changes haven't been made yet
  426.       form.previousRecord = .f.           && Save record number when appending
  427.       form.nextCustButton.SetFocus()      && Since we are at the first
  428.                                           && customer, can only move forward
  429.       if type("form.parentOrdersForm") <> "U"
  430.          form.EscExit = .t.
  431.          form.prevCustButton.enabled  = .f.  && Disable navigation buttons if
  432.          form.nextCustButton.enabled  = .f.  &&   called from orders.
  433.          form.firstCustButton.enabled = .f.
  434.          form.lastCustButton.enabled  = .f.
  435.          form.root.customer.search.enabled = .f.
  436.          form.root.customer.add.enabled = .f.
  437.       endif
  438.    endif
  439.    form::open()                            && Now the form actually opens
  440.  
  441.    ****************************************************************************
  442.    procedure OnClose
  443.    ****************************************************************************
  444.    if this.inEditMode
  445.       form.ViewEdit()
  446.    endif
  447.    if type("form.parentOrdersForm") = "U"  && If called from Orders.wfm, leave shell(.f.)
  448.       shell(.t.)
  449.       close procedure SampProc
  450.       close procedure Orders.wfm
  451.       close procedure Customer.mnu
  452.    endif
  453.  
  454.    ****************************************************************************
  455.    procedure BrowseOnNavigate
  456.    ****************************************************************************
  457.    if eof()
  458.       form.root.customer.viewEdit.enabled = .f.
  459.    else
  460.       form.root.customer.viewEdit.enabled = .t.
  461.    endif
  462.    form.CallShowOrders()
  463.  
  464.    ****************************************************************************
  465.    procedure ChangesMade
  466.    ****************************************************************************
  467.    form.changesMade = .t.
  468.  
  469.    ****************************************************************************
  470.    procedure Next
  471.    ****************************************************************************
  472.    form.CheckCommit(form.inEditMode)
  473.    if .not. eof()
  474.       NEXTBUTTON::OnClick()
  475.    endif
  476.  
  477.    ****************************************************************************
  478.    procedure Previous
  479.    ****************************************************************************
  480.    form.CheckCommit(form.inEditMode)
  481.    PREVBUTTON::OnClick()
  482.  
  483.    ****************************************************************************
  484.    procedure ChildBrowseDblClick
  485.    ****************************************************************************
  486.    form.root.customer.current_orders.OnClick()
  487.  
  488.    ****************************************************************************
  489.    procedure CheckCommit (newInEditMode)
  490.    ****************************************************************************
  491.    private orderField, changesMade
  492.  
  493.    changesMade = form.changesMade
  494.    if form.changesMade .and. form.inEditMode
  495.       orderField = field(1)                  && Field Customer_n
  496.       if ConfirmationMessage("Commit changes?",;
  497.                               FormatStr("Customer %1",&orderField)) = YES
  498.          commit()
  499.       else
  500.          rollback()
  501.          if .not. empty(form.previousRecord)
  502.             go form.previousRecord
  503.             form.previousRecord = .f.
  504.          endif
  505.       endif
  506.       if form.inEditMode .and. newInEditMode
  507.          begintrans()
  508.       endif
  509.       form.changesMade = .f.
  510.    endif
  511.    if form.inEditMode <> newInEditMode
  512.       if newInEditMode                       && Going to Edit mode
  513.          begintrans()
  514.       else                                   && Going to View mode
  515.          if .not. changesMade
  516.             rollback()
  517.          endif
  518.       endif
  519.       form.inEditMode = newInEditMode
  520.    endif
  521.  
  522.    ****************************************************************************
  523.    procedure ViewEdit
  524.    ****************************************************************************
  525.    local inEditMode, editMenu, control
  526.  
  527.    editMenu = form.root.customer.viewEdit
  528.  
  529.    *** If ending edit mode then close transaction, otherwise open it.
  530.    if form.inEditMode
  531.       form.checkChanged(.f.)
  532.       editMenu.text = "&Edit"
  533.       editMenu.shortcut = "Ctrl-E"
  534.       editMenu.statusMessage = "Edit data."
  535.       form.root.customer.delete.enabled = .f.      && disabled in view mode
  536.       form.CheckCommit(.f.)                        && Check transaction and
  537.       form.text = "Customer -- View Mode"          && change mode to View
  538.       form.notesEditor.colorNormal = "N/W"
  539.       form.childBrowse.modify = .f.
  540.       form.notesEditor.modify = .f.
  541.       form.statusmessage = "In View Mode. " + ;
  542.                            "Select Customer - Edit menu to " + ;
  543.                            "edit/delete data."
  544.       form.nextcustbutton.SetFocus()
  545.    else                                            && Switch to edit mode
  546.       editMenu.text = "Vi&ew"
  547.       editMenu.shortcut = "Ctrl-E"
  548.       editMenu.statusMessage = "View data."
  549.       form.root.customer.delete.enabled = .t.      && enabled in edit mode
  550.       form.CheckCommit(.t.)                        && Check transaction and
  551.       form.text = "Customer -- Edit Mode"          && change mode to Edit
  552.       form.childBrowse.modify = .t.
  553.       form.notesEditor.modify = .t.
  554.       form.statusmessage = "In Edit Mode.  " + ;
  555.                            "Select menu Customer - View to switch " + ;
  556.                            "to View mode."
  557.       form.nameEntry.SetFocus()            && Move to the name entryfield
  558.    endif
  559.    inEditMode = form.inEditMode     && Faster if we don't reference a form
  560.    control = form.first             &&    variable each time through the loop
  561.    do
  562.       if .not. control.className $ "BROWSE,EDITOR,NEXTBUTTON,PREVBUTTON,PUSHBUTTON,IMAGE,TEXT"
  563.          control.enabled = inEditMode
  564.       endif
  565.       control = control.before
  566.    until control.name = form.first.name
  567.    form.custNoEntry.enabled = .f.       && Key field is always disabled
  568.    form.nameEntry.SetFocus()            && Move to the name entryfield
  569.  
  570.    ****************************************************************************
  571.    procedure CheckChanged(callCommit)
  572.  
  573.    * Check if changes have been made to the current entryfield.  This procedure
  574.    * is called from menu routines to make sure the form.changesMade gets
  575.    * updated when a menu is selected while the changed control has focus.
  576.    ****************************************************************************
  577.    private control, fieldValue
  578.  
  579.    if form.inEditMode
  580.       control = form.activeControl
  581.       fieldValue = iif(type("control.datalink") <> "U", control.datalink, .f.)
  582.       if type("fieldValue") <> "L" .and. control.value <> &fieldValue
  583.          form.changesMade = .t.
  584.       endif
  585.    endif
  586.    if form.changesMade .and. callCommit
  587.       form.CheckCommit(form.inEditMode)     && Check transactions
  588.    endif
  589.  
  590.    ****************************************************************************
  591.    procedure StartOrdersForm
  592.  
  593.    * Starts the Orders form in it's own session.  Note that control returns
  594.    * to the current session when this procedure is returned from.  This means
  595.    * that between the create session command and return you cannot access
  596.    * tables in the current session.
  597.    ****************************************************************************
  598.    local custNo
  599.  
  600.    custNo = customer->customer_n             && Pass current customer_n into
  601.                                              && orders form in the new session
  602.    create session
  603.    set talk off                              && Set these for the new session
  604.    set ldCheck off
  605.  
  606.    form.childOrdersForm = new OrdersForm()   && Use Orders.wfm to add, view,
  607.                                              && edit, or delete an order.
  608.    form.childOrdersForm.top  =  2.02
  609.    form.childOrdersForm.left =  4.25
  610.    form.childOrdersForm.customer_n = custNo
  611.    form.childOrdersForm.parentCustomerForm = form  && Store a reference to this
  612.                                                    && form so that Orders can
  613.                                                    && call events in this form
  614.    form.childOrdersForm.open()
  615.  
  616.    ****************************************************************************
  617.    procedure CallShowOrders
  618.  
  619.    * Synchronizes the Orders form to the same customer.  This is done when
  620.    * Customer is run first (form.parentOrdersForm is undefined), and the Orders
  621.    * form has been opened (form.childOrdersForm is defined).
  622.    ****************************************************************************
  623.    if type("form.parentOrdersForm") = "U"          && Customer is the parent form
  624.       if type ("form.childOrdersForm") <> "U"      && Orders form has been defined
  625.          form.childOrdersForm.ShowOrders(customer->customer_n, orders->order_no)
  626.       endif
  627.    endif
  628.  
  629.    ****************************************************************************
  630.    procedure ShowCustomer(custNo)
  631.  
  632.    * Called by Orders.wfm when it is the first form run.  Used to synchronize
  633.    * this form to the same customer for a given order displayed in Orders.
  634.    ****************************************************************************
  635.    private pCustNo
  636.    
  637.    form.CheckChanged(.t.)
  638.    set order to customer_n
  639.    pCustNo = custNo                       && Parameters are local so cannot macro
  640.    set key to "&pCustNo"                  && Only see corresponding customer
  641.    go top
  642.  
  643. ENDCLASS
  644.  
  645.  
  646.