i Highly doubt that this code is yours, but try using a a comx or something, and as you type, the suggestions pop up in the comx?
oh, and next time when you post code please use the code tags.
Simply i want to say that my problem is I am using an autosuggest in a textbox.....and when the textbox suggest..example..Firstname and Lastname
Ill search for last name...then that textbox would display Lastname,Firstname...in the meantime my textbox got this code:
con.Open()
Dim dt As New DataTable("Companies")
Dim rs As New OleDb.OleDbDataAdapter("Select * from Companies where Company_Name like '%" & TextBox1.Text & "% ' ", con)
rs.Fill(dt)
DataGridView1.DataSource = dt
DataGridView1.Refresh()
Label1.Text = dt****ws.Count
rs.Dispose()
con.Close()
If Val(Label1.Text) = 1 Then
Dim a1, a2 As String
Dim i As Integer
i = DataGridView1.CurrentRow.Index
a1 = DataGridView1.Item(0, i).Value
a2 = DataGridView1.Item(1, i).Value
TextBox4.Text = a1
TextBox5.Text = a2
End If
and so when I append that suggested Lastname,Firstname ...the data from gridview won't find it..
pls help me..
i Highly doubt that this code is yours, but try using a a comx or something, and as you type, the suggestions pop up in the comx?
oh, and next time when you post code please use the code tags.
Last edited by Raow; 02-17-2013 at 09:36 PM.
^^..thanks for your idea but using comx is the same with textbox and i dnt want to use comx because it has a dropdown arrow.....and i know why my datagridview cant find the data from textbox its because of that line ("Select * from Companies where Company_Name like '%"& Textbox1.text & "%' ",con)
because of this...if only i could code this as ("Select * from Companies where Company_Name+ Contact_Number like '%"& Textbox1.text &"%' ",con)...and yeah I forgot...im using companyname and contact number instead of First_Name and Last_Name. Sorry ^^..but i think its the same idea so..i forgot to write cause im testing it on my other program..that is using that company_name and contact_number lol...^^..thank you.
TextBox1.AutoCompleteCustomSource.Add(r.Item(0).To String + "," + r.Item(1).ToString) <<--- and this line got a separator...so when my textbox append...it would be look Company_Name,Contact_number...example : OrmocNet,5707895 <<<--- so even if my code got concatinator it doesnt get it..and even if i use.......
("Select * from Company where Company_Name + "," + Contact_Number like '%"& textbox1.text &"%' " ,con) <<---this doesn't run...anyone have another way around?...pls help me..
im done with autosuggest..the solution i find is to put a string splitter... but theres still something..like an event in a textbox..i want to check if the user click the suggestions or append the suggestions in a textbox?..anyone pls help me...
you see google right?..when you search and click the suggested text ...it automatically search..without clicking the Search button...thats what I wanna do..
Last edited by Joy4hacks; 02-21-2013 at 08:15 PM.