Re: using the .filter command
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 15 Jan 2008 07:02:02 -0500
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"
.
- Follow-Ups:
- Re: using the .filter command
- From: Chris Anderson [MVP-VB]
- Re: using the .filter command
- Prev by Date: Re: error when connecting to sql db
- Next by Date: Re: MS Access AutoNumber data type
- Previous by thread: error when connecting to sql db
- Next by thread: Re: using the .filter command
- Index(es):
Relevant Pages
|
|