[Gambas-user] Datasource filter

Benoît Minisini gambas at ...1...
Sat Jan 30 16:41:28 CET 2010


> Hello,
> 
> I have two datacombos on my form, i need to select a display value on the
> first, and then when i click on the second datacombo, it to be filtered by
> the first datacombo value. I already tryed:
> 
> PUBLIC SUB DataCombo2_MouseDown()
> 
>   DataSource2.Filter = "cod = " & DataCombo1.Value
>   DataSource2.Refresh()
> 
> END
> 
> and also:
> 
> PUBLIC SUB DataCombo2_MouseDown()
> 
>   DataCombo2.Filter = "code_model = " & DataCombo1.Value
>   DataCombo2.Refresh()
> 
> END
> 
> But the filter does not work at all i still get all results from the
> datacombo2 table! What am i doing wrong?
> 
> Thanks.

First you must use the Click event, not the MouseDown event.

Anyway, the filter should work, but I can't say more without seeing the full 
source code, or at least a partial project that reproduces the bug.

Regards,

-- 
Benoît Minisini




More information about the User mailing list