Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to refresh datalist that bounded to the adodc?

Status
Not open for further replies.

xysong

Technical User
Oct 11, 2001
2
CN
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?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top