Помните, что это просто пример, построенный на предположении:
Public oForm
oForm = Createobject('SampleForm')
oForm.Show()
Define Class SampleForm As Form
Height = 800
Width=600
DataSession = 2
Add Object cmbCustomers As ComboBox With Top=10, Left=10, Width=250
Add Object lstOrders As ListBox With Top=10, Left=280, Height=780, Width=310
Procedure Init
With This.cmbCustomers
.RowSourceType = 3 && -SQL
.RowSource = "select CompanyName, CustomerId from ('"+;
_Samples+;
"Northwind\Customers') into cursor crsCustomers nofilter"
.ListIndex=1
Endwith
With This.lstOrders
.RowSourceType = 3 && -SQL
.RowSource = "select OrderId, OrderDate, ShippedDate, CustomerId from ('"+;
_Samples+;
"Northwind\Orders') o"+;
" where o.CustomerId = crsCustomers.CustomerId"+;
" into cursor crsOrders nofilter"
.ColumnCount = 3
.ColumnWidths = '70,120,120'
Endwith
Endproc
Procedure cmbCustomers.InteractiveChange
With Thisform.lstOrders
.ListIndex = 0
.Requery()
Endwith
Endproc
Enddefine