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.

Hi,

Thank for the replies. Problem solved.
Thank..

Regards,
B.H

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.