Hi Bick:
Jon raises a good point here. I got the code but couldn't get the Access db
to open so i went with his approach. The queries you are using are pretty
complex and it'd take me a while to track it down but I set the rowfilter to
<> on the first line you gave me and it worked like I'd expect. With all of
the concatenation that's going on, I'm 99.99999% sure that it's one of those
that's the problem. If I have some time tonight I'll walk through it and
find the problem but i can't promise anything b/c there's a lot of code. In
the interim, I'd just start commenting out lines of code (that's what I did)
and eliminating them. I got <> to work on the first line so it's not the
problem,. I'll try to nail it down for you shortly.
Bill
--
W.G. Ryan MVP Windows - Embedded
www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
Bick Lamono said:
The DataTable (tblList) has 2914 verified in the immediates window
If you send me an email I will send you the access db. Filtering on
'Good' (RowFilter = "Notes = 'Good'" works fine and returns 4 rows, so I
know the colum is right. I have been trying different RowStateFilter's. I
have tried both current and none with no luck
Here is the code
Private Sub BindGrid()
Dim oQuestionLiteralRows() As FormDS.tblQuestionLiteralRow
Dim oQuestionLiteralRow As FormDS.tblQuestionLiteralRow
Dim oQuestionRow As FormDS.tblQuestionsRow
Dim QuestionID As Int32
Dim LiteralID As Int32
Try
If CampaignDS1 Is Nothing Then
Else
CampaignDS1.tblList.DefaultView.RowFilter = ""
CampaignDS1.tblList.DefaultView.RowStateFilter = DataViewRowState.CurrentRows
If (Me.ddFilterCol.SelectedValue.ToString <> "No Filter"
And Me.ddFilterCol.SelectedValue.ToString said:
Select Case Me.ddFilterCol.SelectedValue.ToString
Case "Link", "Notes"
If Me.ddFilterModifier.SelectedValue = "Like" Then
CampaignDS1.tblList.DefaultView.RowFilter
= String.Concat(Me.ddFilterCol.SelectedValue.ToString, " Like '",
Me.txtFilterText.Value, "%'")
ElseIf Me.ddFilterModifier.SelectedValue = "Like%" Then
CampaignDS1.tblList.DefaultView.RowFilter
= String.Concat(Me.ddFilterCol.SelectedValue.ToString, " Like '%",
Me.txtFilterText.Value, "%'")
Else
CampaignDS1.tblList.DefaultView.RowFilter
= String.Concat(Me.ddFilterCol.SelectedValue.ToString, " ",
Me.ddFilterModifier.SelectedValue, " '", Me.txtFilterText.Value, "'")
End If
Case "BadEmail", "Registered"
If Me.txtFilterText.Value.ToLower = "yes" Or
Me.txtFilterText.Value.ToLower = "no" Then
CampaignDS1.tblList.DefaultView.RowFilter
= String.Concat(Me.ddFilterCol.SelectedValue.ToString, " = ", " '",
Me.txtFilterText.Value, "'")
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " can only be yes or
no.")
End If
Case "EmailsSent", "NoReg", "LoadID", "ID"
If Me.ddFilterModifier.SelectedValue <> "Like"
And Me.ddFilterModifier.SelectedValue said:
If IsNumeric(Me.txtFilterText.Value) Then
CampaignDS1.tblList.DefaultView.RowFilter =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " ",
Me.ddFilterModifier.SelectedValue, " ", Me.txtFilterText.Value)
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " can only be filtered
with numeric data!")
End If
Else
Session("Alert") =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " can only be filtered
using a boolean operator ( said:
End If
Case Else
'if this is a question use the literal for filtering
If
IsNumeric(Me.ddFilterCol.SelectedValue.ToString.Substring(1)) AndAlso
CInt(Me.ddFilterCol.SelectedValue.ToString.Substring(1)) > 199 Then
QuestionID = CInt(Me.ddFilterCol.SelectedValue.ToString.Substring(1))
oQuestionRow = FormDS1.tblQuestions.FindByQuestionID(QuestionID)
If oQuestionRow Is Nothing Then
Exit Select
Else
LiteralID = 0
oQuestionLiteralRows = oQuestionRow.GettblQuestionLiteralRows
For Each oQuestionLiteralRow In oQuestionLiteralRows
If
Me.txtFilterText.Value.ToLower.Trim =
oQuestionLiteralRow.AnswerText.ToLower.Trim Then
LiteralID = oQuestionLiteralRow.LiteralID
Exit For
End If
Next
If LiteralID <> 0 Then
CampaignDS1.tblList.DefaultView.RowFilter =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " = ", LiteralID)
End If
End If
Else
If Me.ddFilterModifier.SelectedValue = "Like" Then
CampaignDS1.tblList.DefaultView.RowFilter =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " ",
Me.ddFilterModifier.SelectedValue, " '", Me.txtFilterText.Value, "%'")
ElseIf Me.ddFilterModifier.SelectedValue = "Like%" Then
CampaignDS1.tblList.DefaultView.RowFilter =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " Like '%",
Me.txtFilterText.Value, "%'")
CampaignDS1.tblList.DefaultView.RowFilter =
String.Concat(Me.ddFilterCol.SelectedValue.ToString, " ",
Me.ddFilterModifier.SelectedValue, " '", Me.txtFilterText.Value, "'")