Usage of ComboBox in Forms

  • Edit


Some times there is a need for a field that is displayed in a Form to take some distinct values. The field itself is of type String. Into the Form, the type must be defined as Combo. In AutoScript the approach is as follows:

proc Form_Start()

  callCbLoad("FIELD_NAME", "VALUE1", "VALUE2", "VALUE3")

end

In cases those values come from a database, then:

proc Form_Start()

   start_sql"*""KOSMOS"
    
SELECTLVALUEFROMLIST_VAL
  
end_sql
  
q = QueryByName()
  
callTExecute(q)
  
count = TRecordCount(q)
  
fori = 1tocount
       
val = TGetFld(q,"LVALUE")

       
callCbLoad("FIELD_NAME",val)

       
callTNext(q)
  
next
  
callFreeEmbSQL(q)

end