Hi All,

Is it possible to filter 2 fields in Adodc?
My code is shown below:

*****-----*****-----
With Adodc2.Recordset
.Filter = "DOC_DATE = '" & myDate & "'"

If .EOF Then
MsgBox "Item Not found"
.Requery
End If
End With
*****-----*****-----
But I need to filter another field on top of that. Is it possible?

Regards,
B.H

yes
you can use filter regular expersion
.Filter ="field1=1 and field2='vlue' or filed3='asd'"

Hi All,

Is it possible to filter 2 fields in Adodc?
My code is shown below:

*****-----*****-----
With Adodc2.Recordset
.Filter = "DOC_DATE = '" & myDate & "'"

If .EOF Then
MsgBox "Item Not found"
.Requery
End If
End With
*****-----*****-----
But I need to filter another field on top of that. Is it possible?

Regards,
B.H

As was previously shown, you need the following:

Set rsConnection = New ADODB.Recordset
rsConnection .Open "SELECT * FROM Users WHERE DateSold >= DateValue('" & txtDate.text & "')", cnConnection, adOpenStatic, adLockOptimistic

Hope this helps out to your solution.

This question has already been answered. Start a new discussion instead.