PDA

Click to See Complete Forum and Search --> : Problem with ADO Filter property


KrakaBug
Mar 14th, 2000, 05:54 PM
I would like to filter a recordset for records which are equal to or after a specified date and chose to use the ADO Filter property.

The code below:

rs.Filter = strField & "=' " & strDate & "'"

is in the FieldName-Operator-Value syntax and works okay but when I made a small change by substituting ">=’" in place of "=’ " I got a runtime error 3001. I did not expect this and I don't understand why the error occurs. How can I fix this?

Elias
Mar 15th, 2000, 09:59 AM
Maybe you need a tick before your variable.

rs.Filter = "'" & strField & "'=' " & strDate & "'"
instead of:
rs.Filter = strField & "=' " & strDate & "'"

-Elias

KrakaBug
Mar 15th, 2000, 04:46 PM
Thanks Elias but it did not work. If you or anyone else have any other ideas on how to solve this problem please post them here. Any suggestions will be very much appreciated.

Thanks in advance.