>I made a combo box From which I select a table from my supplier database. The SQL coding of the RowSource is "Select product.code, product.desc from product where product.supplier = order.supplier into cursor cProductCombo order by product.code".
>
>I found a problem that the data in the cProductCombo cannot change whenever the value of the order.supplier was changed.
>
>Would you please give me any suggestion.
WHat you're doing with the SELECT statement is a LEFT JOIN...this is completely unaffected by the record pointer in 'order'.
What you want is a parameterized view....change the statement to:
Select product.code, product.desc from product where product.supplier = ?order.supplier into cursor cProductCombo order by product.code
Note the "?" in front of order.supplier. This change will give you only those records currently matching the value of order.supplier.
Also, where the order.supplier can be changed, ensure that you call the Requery method of the combo box.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05