rleiman Well-Known Member Licensed User Longtime User Nov 19, 2011 #1 Hi Everyone, I would like to use the value from an EditText box to filter a ListView. Can you look at my coding and let me know what else I need to do to get it to work? So far it only returns 0 rows. B4X: Sub ButtonSearchFilterEventHandler_Click ' Populate the list. '------------------- DBUtils.ExecuteListView(SQL, "SELECT Id, ResultDescription " & _ "FROM VisitResultTypes " & _ "WHERE ResultDescription = ? " & _ "ORDER BY ResultDescription", _ Array As String(EditTextResultDescription.Text), 0, ListViewResults, True) End Sub Thanks.
Hi Everyone, I would like to use the value from an EditText box to filter a ListView. Can you look at my coding and let me know what else I need to do to get it to work? So far it only returns 0 rows. B4X: Sub ButtonSearchFilterEventHandler_Click ' Populate the list. '------------------- DBUtils.ExecuteListView(SQL, "SELECT Id, ResultDescription " & _ "FROM VisitResultTypes " & _ "WHERE ResultDescription = ? " & _ "ORDER BY ResultDescription", _ Array As String(EditTextResultDescription.Text), 0, ListViewResults, True) End Sub Thanks.
vb1992 Well-Known Member Licensed User Longtime User Nov 19, 2011 #2 "WHERE ResultDescription like ? " & might help.. also fool around with the wildcards which is most likely % ex: select * from tablename where name like '%kim%' Last edited: Nov 19, 2011 Upvote 0
"WHERE ResultDescription like ? " & might help.. also fool around with the wildcards which is most likely % ex: select * from tablename where name like '%kim%'
rleiman Well-Known Member Licensed User Longtime User Nov 19, 2011 #3 Hi vb1992, Thanks for the reply. I used this and it worked. B4X: DBUtils.ExecuteListView(SQL, "SELECT Id, ResultDescription " & _ "FROM VisitResultTypes " & _ "WHERE ResultDescription LIKE " & "'" & EditTextSearchFilter.Text & "%' " & _ "ORDER BY ResultDescription", _ Null, 0, ListViewResults, True) Upvote 0
Hi vb1992, Thanks for the reply. I used this and it worked. B4X: DBUtils.ExecuteListView(SQL, "SELECT Id, ResultDescription " & _ "FROM VisitResultTypes " & _ "WHERE ResultDescription LIKE " & "'" & EditTextSearchFilter.Text & "%' " & _ "ORDER BY ResultDescription", _ Null, 0, ListViewResults, True)