i have tried to use two datalists to show two fields from two relevant tables. that is:
use datalist1 show field1 from table1(bounded to adodc1)
use datalist2 show field2 from table2(bounded to adodc2)
field3 from table1 have the relation to field4 from table2(when the database designed,they have not use the same field name, otherwise i can bound the related field directly to the datalist2)
my purpose is: when i change the field1, the field2 is also changed.
my code in the datalist1_click() is
...
tmpstr="select field2 from table2 where field4=(select field3 from table1 where field1='" & datalist1.boundtext & "')"
with adodc2
.recordsourse=tmpstr
.refresh
end with
...
but when i run it,error appeared:
function 'iadodc' of object 'refresh' failed
how can i settle the problem? how to refresh them?
but when i changed adodc2 to data2, datalist2 to dblist2. i succeded! why?
what is the diffrence between datalist and dblist?
use datalist1 show field1 from table1(bounded to adodc1)
use datalist2 show field2 from table2(bounded to adodc2)
field3 from table1 have the relation to field4 from table2(when the database designed,they have not use the same field name, otherwise i can bound the related field directly to the datalist2)
my purpose is: when i change the field1, the field2 is also changed.
my code in the datalist1_click() is
...
tmpstr="select field2 from table2 where field4=(select field3 from table1 where field1='" & datalist1.boundtext & "')"
with adodc2
.recordsourse=tmpstr
.refresh
end with
...
but when i run it,error appeared:
function 'iadodc' of object 'refresh' failed
how can i settle the problem? how to refresh them?
but when i changed adodc2 to data2, datalist2 to dblist2. i succeded! why?
what is the diffrence between datalist and dblist?