* Define properties for the cboCustomer combo box WITH Thisform.cboCustomer .ColumnCount = 2 .ColumnWidths = "200,0" .ColumnLines = .F. .BoundColumn = 2 .RowSourceType = 3 && SQL Statement .RowSource = "select company, cust_id from customer into cursor curCustomer" .Style = 2 && Dropdown list ENDWITH * Define Properties for the lstOrders list box WITH Thisform.lstOrders .RowSourceType = 2 && Alias .ColumnCount = 4 .ColumnWidths = "100,100,100,100" ENDWITHThe Valid() event of cboCustomer has the following code
Thisform.lstOrders.RowSource = '' SELECT order_id,order_date, order_amt, shipped_on FROM orders ; WHERE cust_id = This.value ; INTO CURSOR curSelectedOrders ; ORDER BY order_id Thisform.lstOrders.RowSource = 'curSelectedOrders'The form runs fine in VFP 8. As soon as I select a new customer, the list box displays the orders for that customer in the list box. However, when I ran the same form in VFP 9 on some other computer, I see strange behaviour, e.g. list box disappears, list box does not refresh, list box appears when I click on the disappeared list box, etc. I added code to refresh the list box and/or the form, but it did not help.