PDA

View Full Version : Solved: Recordest Filter



Maxa
06-10-2008, 10:06 PM
Hi,

I have a problem with filtering my Database.
The thing is I need to filter against the range (counterparty IDs), which is located in a different page. For that purpose I activate that worksheet, and then the fun begins.

My code looks something like this:

Worksheets("CnptyNames").Activate
rst.Filter = "COUNTERPARTYCODE >= " & Range("e4") & "and COUNTERPARTYCODE <=" & Range("e26")

Here is the message I get:
"Run-time error "3001": Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."


Any help will be very much appreciated.

Bob Phillips
06-11-2008, 01:57 AM
Is it simply a lack of a space before the AND?



rst.Filter = "COUNTERPARTYCODE >= " & Range("E4").Value & " AND " & _
"COUNTERPARTYCODE <=" & Range("E26").Value

Maxa
06-11-2008, 02:26 AM
xld,

Thanks a lot!!!:clap: it works perfectly now.
I was always get lost somewhrere around ampersands and quotes.