How to filter with more than one criteria in adodc??
Dear All,
Hope all are in fine tune.
I wanna ask you "How to filter with more than one criteria in adodc in vb6??"
I used that code, Adodc1.Recordset.Filter = "device_code=" & dv.Text1.Text,
to filter with one criteria and i wanna add onther criteria to this code.
Thx u all.
Best Regards,
Shimaa
Re: How to filter with more than one criteria in adodc??
Hi Shimaa,
Use this code to solve ur problem
Code:
Adodc1.Recordset.Filter = "device_code=" & dv.Text1.Text & " or device_code=" & dv.Text2.Text
you can also use "AND" operator for multiple filter
:thumb: Hope this will help u....
Re: How to filter with more than one criteria in adodc??
Dear yadavrahul143 ,
Thank u alot for helping me but what if the second criteria belongs to another field in the database, that I will filter with
1. Device_code
2. comp_no
and the value of device code in text1 and the value of comp code in text2.
Thank u
Best regards
Shimaa
Re: How to filter with more than one criteria in adodc??
Move away from bound controls to programming code and SQL queries.
You can filter, literally, by anything you want providing it actually exists.
Re: How to filter with more than one criteria in adodc??
Hi,
This is just an example of how to use multiple filter. You can add any number of fields and criterias while filtering records..
Code:
Adodc1.Recordset.Filter = "device_code=" & dv.Text1.Text & " or comp_no=" & dv.Text2.Text
:-)