Write the following WLanguage code in the "Click" event of the Combo:
// Finds the customer from his identifier
HReadSeekFirst(Customer, CustomerID, COMBO_Customer)
IF HFound(Customer) THEN
FileToScreen()
END
•HReadSeekFirst is used to perform an exact-match search. In this example, the search is performed on the Customer data file and on the CustomerID item. The searched value corresponds to the last parameter of the function. Here, the searched value corresponds to the value selected in the Combo Box. This value is obtained by using the name of the Combo Box control (COMBO_Customer).
•HFound is used to check the search result. If HFound returns True, a value was found ; if HFound returns False, no value was found. Any record found is read: it becomes the current record in the data file.
•In this code, if the record was found, it is displayed by FileToScreen.