|
|
|
|
|
- Overview
- Tip: How do I refresh the contents of an Auto-filled Combo Box control whose source is a query?
- Initialization code of a Combo Box control programmatically linked to a data file
Linking a Combo Box control to a data file
A List Box or Combo Box control can be used to display the content of a data file, to allow a user to select a record, for example. A Combo Box control can be initialized with the content of a data file: - or automatically no specific code is required to initialize the field. The options to loop through the data file linked to the control can be defined in the "Content" tab of the control description.
- or by programming You need to enter the path code of the data file linked to the Combo Box control in the field initialization code. This method is not recommended.
Note When creating a Combo Box control, the wizard asks for the information required to create a Combo Box control linked to a data file. Tip: How do I refresh the contents of an Auto-filled Combo Box control whose source is a query? If you are using a Combo Box control based on a query with automatic initialization, to refresh the control content, type the following code (in the initialization code of the control for example). This code performs the following operations: - Execute the base query of the Combo Box control again (specifying the query parameters, if necessary) with HExecuteQuery.
- Display the content of the Combo Box control again with ListDisplay.
HExecuteQuery(MyQRY, hQueryDefault, Param1, Param2)
ListDisplay(COMBO_ComboName, taStart)
Initialization code of a Combo Box control programmatically linked to a data file If you use a Combo Box control based on a data file with programmed initialization, you must write the code to loop through the data file in the control initialization code. For example Initialization of a Combo Box control with clients from the CLIENT data file.
HReadFirst(CUSTOMER, CustName)
WHILE NOT HOut()
ListAdd(COMBO_Combo1, Customer.CustName)
HReadNext(CUSTOMER, CustName)
END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|