Right on the typos. Does not matter if the vars go out of scope as long as you call the combo requery() before they go out of scope. The SQL is only run when called by the requery.
>Mark,
>
>I guess, it's a typo in your code. DisplayValue is a property, not a method. I made the corrections.
>
>BTW, I guess, your code would not work (though I didnt' try). These variables would go out of scope. Better to use form's properties, as Sergey suggested.
>
>>Let's try to simplify and clean this up first. You can remove the AND NOT DELETED() if you already have SET DELETED ON.
>In form's Init:
>>WITH THISFORM
>> .cboQuadra.ROWSOURCETYPE = 3
>> .cboQuadra.ROWSOURCE = "SELECT nome_num, codigo FROM quadras ;
>> WHERE NOT DELETED()AND cod_loteamento = ?cCBO1_Value ;
>> order by nome_num INTO CURSOR cur_quadras"
>>
>> .cboLote.ROWSOURCETYPE = 3
>> .cboLote.ROWSOURCE = "SELECT numero, codigo FROM lotes ;
>> WHERE lotes.Status = stat_venda AND NOT DELETED() ;
>> AND cod_quadra = ?cCBO2_Value order by numero INTO CURSOR cur_lotes"
>>ENDWITH
>>In the InterActiveChange of Combo1:
>>DoDefault()
>>local cCBO1_Value
>>cCBO1_Value = This.DisplayValue
>>This.Parent.cbo2.Requery()
>>In the InterActiveChange of Combo2:
>>DoDefault()
>>local cCBO2_Value
>>cCBO2_Value = This.DisplayValue
>>This.Parent.cbo3.Requery()
>>
>>
>>>I have 3 combos in a form (cbo1, cbo2, cbo3)the second combo cbo2 value depends ond the value chossen in cbo1 and the same happends with cbo3.
>>>
>>>When I move the pointer in the table, I allways rebuild the cursors on which cbo2 and cbo3 are based calling a function.
>>>
>>>Thanks in Advance
>>>
>>>Peter
Mark McCasland
Midlothian, TX USA