Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


filter all values greater than given in ms access database


filter all values greater than given in ms access database

Author
Message
blueye89
blueye89
Forum God
Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)

Group: Forum Members
Posts: 7, Visits: 15
Hi there. I need to filter all values which are greater than an given value in textbox and show them in datatable? I need quick answer please.
Edited
2/17/2013 by blueye89
zack
zack
Forum God
Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)

Group: Forum Members
Posts: 102, Visits: 110
So the filtered values that are greater than the given value are the ones saved to the database?
blueye89
blueye89
Forum God
Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)Forum God (2.1K reputation)

Group: Forum Members
Posts: 7, Visits: 15
zack (2/17/2013)
So the filtered values that are greater than the given value are the ones saved to the database?




Yes. They are in database. Form at the start get values from database and shows in datagridview. I need to search on them.





Dim dv As New DataView(Me.mydatabaseDataSet.Table1)

dv.RowFilter = "Column1 > Val(TextBox1.Text)"

DataGridView1.DataSource = dv





But, at the second row is a problem.



zack
zack
Forum God
Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)

Group: Forum Members
Posts: 102, Visits: 110
Are you getting a specific error on second line? If so, what is the error message?
zeroGiven
zeroGiven
Forum God
Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)Forum God (684 reputation)

Group: Forum Members
Posts: 2, Visits: 9
Dim dv As New DataView(Me.mydatabaseDataSet.Table1)

dv.RowFilter = "Column1 > Val(TextBox1.Text)"

DataGridView1.DataSource = dv




I'm going to assume that the reason for your problem is your basically asking for column1 to be greater than Val(TextBox1.Text) and that TextBox1.Text is not a number. Now wait. Let me explain what I mean.



That line is taken as a literal string



Column1 > Val(TextBox1.Text) exactly that.



What I think you're wanting to do is concatenate what is in TextBox1's .Text property to the RowFilter as such



dv.RowFilter = "Column1 > Val(" & TextBox1.Text & ")"



So in this example let's say that you entered 55 in textbox1 this would result in

dv.RowFilter = "Column1 > Val("55")" and should no longer produce an error.
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search