Re: using the .filter command



Chris wrote:
Hi everyone, i am have a problem, can anybody please help?

My problem is, I am using a DataGrid that is populated with data,
and I am trying to "filter" it with 2 different criteria's,
EmployeeNumber and date.

Below is the code that I have, but does not work as it comes up with
an error.

How can we help if you don't tell us what the error is?

With Adodc1.Recordset
.Filter = ("EmployeeNumber = " & Val(Text2) And ("EntryDate < " &
DateValue(Text4)))

Was this a copy/paste from your code? or did you introduce a type when
retyping it here?
It should be more like this (I suggest assigning the filter string to a
variable to make it easier for you to look at the result of your
concatenation - is this VB? If so, you can use debug to look at it):

flt_txt = "EmployeeNumber = " & Val(Text2) & _
"And EntryDate < " & DateValue(Text4)
..Filter = flt_txt

However, this may not be the exact string needed because we don't know the
data types of the fields involved.

Please anybody able to shed any light on my problem?

The ADO documentation can be read online here:
http://msdn2.microsoft.com/en-us/library/ms675532.aspx

Make sure you go read what it says about the Filter property:


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Copy from recordset errors in ADO
    ... Probably being a bit dim but do not see what you mean by filter it. ... with kind regards ... If there are different data types in the column ADO will copy only the Data type that have the majority. ... I am extracting approx 600 rows of data and ...
    (microsoft.public.excel.programming)
  • Re: PopUp form to filter report
    ... You'll need to monitor the data types and build up the SQL WHERE ... >clicks a Filter button to perform the actual filter. ... >' Build SQL String. ...
    (microsoft.public.access.formscoding)
  • Re: PopUp form to filter report
    ... >You'll need to monitor the data types and build up the ... >>I have a popup form that filters fields in for a report, ... >>clicks a Filter button to perform the actual filter. ... >>' Build SQL String. ...
    (microsoft.public.access.formscoding)
  • Re: hardware raid solutions?
    ... this filter system runs inside of postfix using the pre and post queuing filters stages ... proof of work stamp test, make a stamp, passed directly to inbox ... where the human can interpret whether the messages are spam or not. ... the spam trap user interface is a simple mechanism for recategorizing messages they could not be analyzed by any the other stages. ...
    (Ubuntu)
  • Re: Recordset.Save Method Does Not Persist Filtered Data
    ... Where are the items populating this array coming from? ... to use a sql join to filter the records I want to retrieve. ... Does whatever database you are using have native ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)