Usage of ComboBox in Forms
Sometimes there is a need for a field displayed in a Form to take some distinct values. The field itself is of type String. Into the Form, we must define the type 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