You can easily customize this default data retrieval by using a tool called the Query Builder, where you can define a WHERE clause and other elements of a query much as you defined the FOR EACH statement in “Use Basic ABL Constructs”.

To bring up the Query Builder for the CustQuery frame:

  1. Double-click on the frame background. Alternatively, select the Object Properties button from the toolbar:
    The property sheet for the frame appears, where you can define various frame properties:
  2. Click the Query button to bring up the Query Builder.
  3. To define a WHERE clause of State = “NH”, select the Where radio set button from the set of options at the top of the Query Builder.
  4. Select State from the list of Customer fields:
  5. Click the equal sign (=) button.
    This brings up the Enter Constant dialog box where you can enter the State value NH. The Query Builder provides the quotation marks for you:
  6. Click OK to return to the Query Builder.
  7. To add a sort clause BY City to your query, select the Sort radio set button.
  8. Select the City field by double-clicking on it or by selecting it and clicking the Add>> button:
  9. Click OK to leave the Query Builder.
  10. Click OK again to leave the frame’s property sheet.
  11. Run your window again.
    The first Customer is displayed again, but this time it is the first Customer in the State of New Hampshire, sorted by City: