ValueSource Property
Setting VALUESOURCE property to a fieldname, its containt is returned instead the physical record number for ComboBox control

 

 

  

Syntax:

 

ValueSource <xcValue>

 

This property is used by ComboBox control linked to a table field via ‘ItemSource’ property.

 

 

Sample:

 

 

Function Main()        

 

      DEFINE WINDOW Form_1               ;

            AT 0,0                       ;

            WIDTH 365                     ; 

            HEIGHT 120                    ;

            TITLE "Exemplos ComboBox New" ;          

            MAIN                          ;     

            ON INIT OpenTables()         ;

            ON RELEASE CloseTables()

 

            DEFINE MAIN MENU

                  DEFINE POPUP '&Test'

                        MENUITEM 'Get Value' ACTION MsgInfo( Form_1.Combo_1.Value )

                        MENUITEM 'Set Value' ACTION Form_1.Combo_1.Value := 2

                        MENUITEM 'Refresh' ACTION Form_1.Combo_1.Refresh

                  END POPUP

            END MENU

 

            @010,010 COMBOBOX Combo_1          ;

                  ITEMSOURCE CIDADES->DESCRICAO ;

                  VALUESOURCE CIDADES->DESCRICAO  ;

                  WIDTH 200               ;

                  FONT "Arial" SIZE 9          ;

                  TOOLTIP "Combo Cidades"

 

      END WINDOW       

 

      CENTER WINDOW Form_1

 

      ACTIVATE WINDOW Form_1

 

Return

Procedure Opentables()

      Use Cidades Alias Cidades New

      Index On Descricao To Cidades1

Return

Procedure CloseTables()

      Use
Return