Dim SQL as String SQL="select * from link where 1=1" if name<>"" then SQL=SQL+" and name='"+name+"'" if no<>"" then SQL=SQL+" and no='"+no+"'" if prdno<>"" then SQL=SQL+" and prdno='"+prdno+"'" ‘…… Adodc1.RecordSource= SQL ’……